Class: ChefMetal::ActionHandlerForward
- Inherits:
-
Chef::EventDispatch::Base
- Object
- Chef::EventDispatch::Base
- ChefMetal::ActionHandlerForward
- Defined in:
- lib/chef_metal.rb
Instance Attribute Summary collapse
-
#action_handler ⇒ Object
readonly
Returns the value of attribute action_handler.
Instance Method Summary collapse
-
#initialize(action_handler) ⇒ ActionHandlerForward
constructor
A new instance of ActionHandlerForward.
- #resource_update_applied(resource, action, update) ⇒ Object
Constructor Details
#initialize(action_handler) ⇒ ActionHandlerForward
Returns a new instance of ActionHandlerForward.
14 15 16 |
# File 'lib/chef_metal.rb', line 14 def initialize(action_handler) @action_handler = action_handler end |
Instance Attribute Details
#action_handler ⇒ Object (readonly)
Returns the value of attribute action_handler.
18 19 20 |
# File 'lib/chef_metal.rb', line 18 def action_handler @action_handler end |
Instance Method Details
#resource_update_applied(resource, action, update) ⇒ Object
20 21 22 23 24 |
# File 'lib/chef_metal.rb', line 20 def resource_update_applied(resource, action, update) prefix = action_handler.should_perform_actions ? "" : "Would " update = Array(update).flatten.map { |u| "#{prefix}#{u}"} action_handler.performed_action(update) end |