Class: ActionFactory::AttributeAssigner
- Inherits:
-
Object
- Object
- ActionFactory::AttributeAssigner
- Defined in:
- lib/action_factory/attribute_assigner.rb
Instance Method Summary collapse
- #assign(attributes) ⇒ Object
-
#initialize(instance) ⇒ AttributeAssigner
constructor
A new instance of AttributeAssigner.
Constructor Details
#initialize(instance) ⇒ AttributeAssigner
Returns a new instance of AttributeAssigner.
6 7 8 |
# File 'lib/action_factory/attribute_assigner.rb', line 6 def initialize(instance) @instance = instance end |
Instance Method Details
#assign(attributes) ⇒ Object
10 11 12 13 14 |
# File 'lib/action_factory/attribute_assigner.rb', line 10 def assign(attributes) attributes.each do |name, value| @instance.public_send("#{name}=", value) end end |