Class: VGen::UpperLetterGen

Inherits:
Object
  • Object
show all
Defined in:
lib/v_gen/upper_letter_gen.rb

Instance Method Summary collapse

Constructor Details

#initialize(only: ("A".."Z"), except: []) ⇒ UpperLetterGen

Returns a new instance of UpperLetterGen.



3
4
5
# File 'lib/v_gen/upper_letter_gen.rb', line 3

def initialize(only: ("A".."Z"), except: [])
  @only, @except = only, except
end

Instance Method Details

#callObject



7
8
9
10
# File 'lib/v_gen/upper_letter_gen.rb', line 7

def call()
  (@only.to_a.map(&:upcase) - @except.to_a.map(&:upcase))
    .sample
end