Class: FactoryGirl::Attribute::Sequence

Inherits:
FactoryGirl::Attribute show all
Defined in:
lib/factory_girl/attribute/sequence.rb

Instance Attribute Summary

Attributes inherited from FactoryGirl::Attribute

#ignored, #name

Instance Method Summary collapse

Methods inherited from FactoryGirl::Attribute

#<=>, #==, #aliases_for?, #association?, #priority

Constructor Details

#initialize(name, sequence, ignored) ⇒ Sequence

Returns a new instance of Sequence.



5
6
7
8
# File 'lib/factory_girl/attribute/sequence.rb', line 5

def initialize(name, sequence, ignored)
  super(name, ignored)
  @sequence = sequence
end

Instance Method Details

#add_to(proxy) ⇒ Object



10
11
12
13
# File 'lib/factory_girl/attribute/sequence.rb', line 10

def add_to(proxy)
  value = FactoryGirl.generate(@sequence)
  set_proxy_value(proxy, value)
end