Class: FactoryGirl::Decorator::AttributeHash
- Inherits:
-
FactoryGirl::Decorator
- Object
- FactoryGirl::Decorator
- FactoryGirl::Decorator::AttributeHash
- Defined in:
- lib/factory_girl/decorator/attribute_hash.rb
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(component, attributes = []) ⇒ AttributeHash
constructor
A new instance of AttributeHash.
Methods inherited from FactoryGirl::Decorator
const_missing, #method_missing, #send
Constructor Details
#initialize(component, attributes = []) ⇒ AttributeHash
Returns a new instance of AttributeHash.
4 5 6 7 |
# File 'lib/factory_girl/decorator/attribute_hash.rb', line 4 def initialize(component, attributes = []) super(component) @attributes = attributes end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class FactoryGirl::Decorator
Instance Method Details
#attributes ⇒ Object
9 10 11 12 13 14 |
# File 'lib/factory_girl/decorator/attribute_hash.rb', line 9 def attributes @attributes.inject({}) do |result, attribute_name| result[attribute_name] = send(attribute_name) result end end |