Class: PositionalGenerator::Builder::Letter
- Inherits:
-
Object
- Object
- PositionalGenerator::Builder::Letter
- Defined in:
- lib/helpers/positional_generator.rb
Instance Method Summary collapse
- #generate(_) ⇒ Object
-
#initialize(length, ranges) ⇒ Letter
constructor
A new instance of Letter.
Constructor Details
#initialize(length, ranges) ⇒ Letter
Returns a new instance of Letter.
430 431 432 433 |
# File 'lib/helpers/positional_generator.rb', line 430 def initialize(length, ranges) @length = length @ranges = ranges end |
Instance Method Details
#generate(_) ⇒ Object
435 436 437 438 439 440 |
# File 'lib/helpers/positional_generator.rb', line 435 def generate(_) @length.times.inject('') do |acc, _index| generated_character = char "#{acc}#{generated_character}" end end |