Class: FixtureFactory::Sequence
- Inherits:
-
Object
- Object
- FixtureFactory::Sequence
- Includes:
- Enumerable
- Defined in:
- lib/fixture_factory/sequence.rb
Overview
:nodoc:
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize ⇒ Sequence
constructor
A new instance of Sequence.
- #next ⇒ Object
Constructor Details
#initialize ⇒ Sequence
Returns a new instance of Sequence.
7 8 9 |
# File 'lib/fixture_factory/sequence.rb', line 7 def initialize @count = 0 end |
Instance Method Details
#each ⇒ Object
15 16 17 |
# File 'lib/fixture_factory/sequence.rb', line 15 def each loop { yield(self.next) } end |
#next ⇒ Object
11 12 13 |
# File 'lib/fixture_factory/sequence.rb', line 11 def next @count += 1 end |