Class: FactoryGirl::Attribute::Association

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

Overview

:nodoc:

Instance Attribute Summary collapse

Attributes inherited from FactoryGirl::Attribute

#ignored, #name

Instance Method Summary collapse

Methods inherited from FactoryGirl::Attribute

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

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

#factoryObject (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

#add_to(proxy) ⇒ Object



12
13
14
# File 'lib/factory_girl/attribute/association.rb', line 12

def add_to(proxy)
  proxy.associate(name, @factory, @overrides)
end

#association?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/factory_girl/attribute/association.rb', line 16

def association?
  true
end