Method: FactoryBot::Sequence#next

Defined in:
lib/factory_bot/sequence.rb

#next(scope = nil) ⇒ Object

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.



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/factory_bot/sequence.rb', line 37

def next(scope = nil)
  if @proc && scope
    scope.instance_exec(value, &@proc)
  elsif @proc
    @proc.call(value)
  else
    value
  end
ensure
  increment_value
end