Class: VGen::LetterGen

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

Instance Method Summary collapse

Constructor Details

#initialize(only: (("A".."Z").to_a + ("a".."z").to_a), except: []) ⇒ LetterGen

Returns a new instance of LetterGen.



3
4
5
6
7
8
# File 'lib/v_gen/letter_gen.rb', line 3

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

Instance Method Details

#callObject



10
11
12
# File 'lib/v_gen/letter_gen.rb', line 10

def call()
  (@only.to_a - @except.to_a).sample
end