Class: RandomSet::Template::CustomGenerator
- Inherits:
-
Object
- Object
- RandomSet::Template::CustomGenerator
- Defined in:
- lib/random_set/template.rb
Instance Attribute Summary collapse
- #block ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(block) ⇒ CustomGenerator
constructor
A new instance of CustomGenerator.
- #next ⇒ Object
Constructor Details
#initialize(block) ⇒ CustomGenerator
Returns a new instance of CustomGenerator.
77 78 79 80 |
# File 'lib/random_set/template.rb', line 77 def initialize(block) @block = block @iteration = 0 end |
Instance Attribute Details
#block ⇒ Object (readonly)
82 83 84 |
# File 'lib/random_set/template.rb', line 82 def block @block end |
Instance Method Details
#next ⇒ Object
84 85 86 87 88 |
# File 'lib/random_set/template.rb', line 84 def next block.call @iteration ensure @iteration += 1 end |