Class: FloorManager::Employee::AttributeAction::AssocAppend
- Defined in:
- lib/floor_manager/employee/attribute_action.rb
Overview
Stores the action of producing another employee via a collection proxy stored in field.
Instance Method Summary collapse
- #apply(obj, floor, employee) ⇒ Object
-
#initialize(field, create_args) ⇒ AssocAppend
constructor
A new instance of AssocAppend.
Methods inherited from Base
Constructor Details
#initialize(field, create_args) ⇒ AssocAppend
Returns a new instance of AssocAppend.
27 28 29 30 |
# File 'lib/floor_manager/employee/attribute_action.rb', line 27 def initialize(field, create_args) super field @create_args = create_args end |
Instance Method Details
#apply(obj, floor, employee) ⇒ Object
31 32 33 34 |
# File 'lib/floor_manager/employee/attribute_action.rb', line 31 def apply(obj, floor, employee) instance = floor.build(*@create_args) get(obj) << instance end |