Class: Chef::Provisioning::ActionHandlerForward

Inherits:
EventDispatch::Base
  • Object
show all
Defined in:
lib/chef/provisioning.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action_handler) ⇒ ActionHandlerForward

Returns a new instance of ActionHandlerForward.



16
17
18
# File 'lib/chef/provisioning.rb', line 16

def initialize(action_handler)
  @action_handler = action_handler
end

Instance Attribute Details

#action_handlerObject (readonly)

Returns the value of attribute action_handler.



20
21
22
# File 'lib/chef/provisioning.rb', line 20

def action_handler
  @action_handler
end

Instance Method Details

#resource_update_applied(resource, action, update) ⇒ Object



22
23
24
25
26
# File 'lib/chef/provisioning.rb', line 22

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