Class: VGen::UpperLetterGen
- Inherits:
-
Object
- Object
- VGen::UpperLetterGen
- Defined in:
- lib/v_gen/upper_letter_gen.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(only: ("A".."Z"), except: []) ⇒ UpperLetterGen
constructor
A new instance of UpperLetterGen.
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
#call ⇒ Object
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 |