Class: Chef::Provisioning::AddPrefixActionHandler

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/chef/provisioning/add_prefix_action_handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action_handler, prefix) ⇒ AddPrefixActionHandler

Returns a new instance of AddPrefixActionHandler.



8
9
10
11
# File 'lib/chef/provisioning/add_prefix_action_handler.rb', line 8

def initialize(action_handler, prefix)
  @action_handler = action_handler
  @prefix = prefix
end

Instance Attribute Details

#action_handlerObject (readonly)

Returns the value of attribute action_handler.



13
14
15
# File 'lib/chef/provisioning/add_prefix_action_handler.rb', line 13

def action_handler
  @action_handler
end

#locally_updatedObject (readonly)

Returns the value of attribute locally_updated.



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

def locally_updated
  @locally_updated
end

#prefixObject (readonly)

Returns the value of attribute prefix.



14
15
16
# File 'lib/chef/provisioning/add_prefix_action_handler.rb', line 14

def prefix
  @prefix
end

Instance Method Details

#perform_action(description, &block) ⇒ Object



29
30
31
32
# File 'lib/chef/provisioning/add_prefix_action_handler.rb', line 29

def perform_action(description, &block)
  @locally_updated = true
  action_handler.perform_action(Array(description).flatten.map { |d| "#{prefix}#{d}" }, &block)
end

#performed_action(description) ⇒ Object



24
25
26
27
# File 'lib/chef/provisioning/add_prefix_action_handler.rb', line 24

def performed_action(description)
  @locally_updated = true
  action_handler.performed_action(Array(description).flatten.map { |d| "#{prefix}#{d}" })
end

#report_progress(description) ⇒ Object



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

def report_progress(description)
  @locally_updated = true
  action_handler.report_progress(Array(description).flatten.map { |d| "#{prefix}#{d}" })
end