Class: RomFactory::Attributes::Sequence
- Inherits:
-
Object
- Object
- RomFactory::Attributes::Sequence
- Defined in:
- lib/rom_factory/attributes/sequence.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(&block) ⇒ Sequence
constructor
A new instance of Sequence.
Constructor Details
#initialize(&block) ⇒ Sequence
Returns a new instance of Sequence.
4 5 6 7 |
# File 'lib/rom_factory/attributes/sequence.rb', line 4 def initialize(&block) @count = 0 @block = block end |
Instance Method Details
#call ⇒ Object
9 10 11 |
# File 'lib/rom_factory/attributes/sequence.rb', line 9 def call @block.call(@count += 1) end |