Class: FactoryGirl::Attribute::Association
- Inherits:
-
FactoryGirl::Attribute
- Object
- FactoryGirl::Attribute
- FactoryGirl::Attribute::Association
- Defined in:
- lib/factory_girl/attribute/association.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#factory ⇒ Object
readonly
Returns the value of attribute factory.
Attributes inherited from FactoryGirl::Attribute
Instance Method Summary collapse
- #association? ⇒ Boolean
-
#initialize(name, factory, overrides) ⇒ Association
constructor
A new instance of Association.
- #to_proc(proxy) ⇒ Object
Methods inherited from FactoryGirl::Attribute
Constructor Details
#initialize(name, factory, overrides) ⇒ Association
Returns a new instance of Association.
6 7 8 9 10 |
# File 'lib/factory_girl/attribute/association.rb', line 6 def initialize(name, factory, overrides) super(name, false) @factory = factory @overrides = overrides end |
Instance Attribute Details
#factory ⇒ Object (readonly)
Returns the value of attribute factory.
4 5 6 |
# File 'lib/factory_girl/attribute/association.rb', line 4 def factory @factory end |
Instance Method Details
#association? ⇒ Boolean
18 19 20 |
# File 'lib/factory_girl/attribute/association.rb', line 18 def association? true end |
#to_proc(proxy) ⇒ Object
12 13 14 15 16 |
# File 'lib/factory_girl/attribute/association.rb', line 12 def to_proc(proxy) factory = @factory overrides = @overrides lambda { proxy.association(factory, overrides) } end |