Class: Factory::Proxy::AttributesFor

Inherits:
Factory::Proxy show all
Defined in:
lib/factory_girl/proxy/attributes_for.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Factory::Proxy

#callbacks

Instance Method Summary collapse

Methods inherited from Factory::Proxy

#add_callback, #associate, #association, #method_missing, #run_callbacks

Constructor Details

#initialize(klass) ⇒ AttributesFor

Returns a new instance of AttributesFor.



4
5
6
# File 'lib/factory_girl/proxy/attributes_for.rb', line 4

def initialize(klass)
  @hash = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Factory::Proxy

Instance Method Details

#get(attribute) ⇒ Object



8
9
10
# File 'lib/factory_girl/proxy/attributes_for.rb', line 8

def get(attribute)
  @hash[attribute]
end

#resultObject



16
17
18
# File 'lib/factory_girl/proxy/attributes_for.rb', line 16

def result
  @hash
end

#set(attribute, value) ⇒ Object



12
13
14
# File 'lib/factory_girl/proxy/attributes_for.rb', line 12

def set(attribute, value)
  @hash[attribute] = value
end