Class: FloorManager::Employee::AttributeAction::AssocSet
- Defined in:
- lib/floor_manager/employee/attribute_action.rb
Overview
Stores the action of producing another employee via the floor and then storing that as a value.
Instance Method Summary collapse
- #apply(obj, floor, employee) ⇒ Object
-
#initialize(field, create_args) ⇒ AssocSet
constructor
A new instance of AssocSet.
Methods inherited from Base
Constructor Details
#initialize(field, create_args) ⇒ AssocSet
Returns a new instance of AssocSet.
40 41 42 43 |
# File 'lib/floor_manager/employee/attribute_action.rb', line 40 def initialize(field, create_args) super field @create_args = create_args end |
Instance Method Details
#apply(obj, floor, employee) ⇒ Object
44 45 46 47 |
# File 'lib/floor_manager/employee/attribute_action.rb', line 44 def apply(obj, floor, employee) assoc_obj = floor.build(*@create_args) set(obj, assoc_obj) end |