Class: Factory::Attribute::Association

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

Overview

:nodoc:

Instance Attribute Summary collapse

Attributes inherited from Factory::Attribute

#name

Instance Method Summary collapse

Constructor Details

#initialize(name, factory, overrides) ⇒ Association

Returns a new instance of Association.



8
9
10
11
12
# File 'lib/factory_girl/attribute/association.rb', line 8

def initialize(name, factory, overrides)
  super(name)
  @factory   = factory
  @overrides = overrides
end

Instance Attribute Details

#factoryObject (readonly)

Returns the value of attribute factory.



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

def factory
  @factory
end

Instance Method Details

#add_to(proxy) ⇒ Object



14
15
16
# File 'lib/factory_girl/attribute/association.rb', line 14

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