Class: FactoryBot::Sequence::EnumeratorAdapter Private

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ EnumeratorAdapter

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of EnumeratorAdapter.



52
53
54
55
# File 'lib/factory_bot/sequence.rb', line 52

def initialize(value)
  @first_value = value
  @value = value
end

Instance Method Details

#nextObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



61
62
63
# File 'lib/factory_bot/sequence.rb', line 61

def next
  @value = @value.next
end

#peekObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



57
58
59
# File 'lib/factory_bot/sequence.rb', line 57

def peek
  @value
end

#rewindObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



65
66
67
# File 'lib/factory_bot/sequence.rb', line 65

def rewind
  @value = @first_value
end