Class: RomFactory::Attributes::Sequence

Inherits:
Object
  • Object
show all
Defined in:
lib/rom_factory/attributes/sequence.rb

Instance Method Summary collapse

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

#callObject



9
10
11
# File 'lib/rom_factory/attributes/sequence.rb', line 9

def call
  @block.call(@count += 1)
end