Class: FloorManager::Employee::AttributeAction::AssocSet

Inherits:
Base
  • Object
show all
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

Methods inherited from Base

#get, #set

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