Class: FloorManager::Employee::AttributeAction::Block
- Defined in:
- lib/floor_manager/employee/attribute_action.rb
Overview
Stores the action of setting an attribute to the result of a block.
Instance Method Summary collapse
- #apply(obj, floor, employee) ⇒ Object
-
#initialize(name, block) ⇒ Block
constructor
A new instance of Block.
Methods inherited from Base
Constructor Details
#initialize(name, block) ⇒ Block
Returns a new instance of Block.
63 64 65 66 |
# File 'lib/floor_manager/employee/attribute_action.rb', line 63 def initialize(name, block) super(name) @block = block end |
Instance Method Details
#apply(obj, floor, employee) ⇒ Object
67 68 69 |
# File 'lib/floor_manager/employee/attribute_action.rb', line 67 def apply(obj, floor, employee) set(obj, @block.call(obj, floor)) end |