Class: ChefMetal::AddPrefixActionHandler

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/chef_metal/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.



7
8
9
10
# File 'lib/chef_metal/add_prefix_action_handler.rb', line 7

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.



12
13
14
# File 'lib/chef_metal/add_prefix_action_handler.rb', line 12

def action_handler
  @action_handler
end

#prefixObject (readonly)

Returns the value of attribute prefix.



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

def prefix
  @prefix
end

Instance Method Details

#perform_action(description, &block) ⇒ Object



25
26
27
# File 'lib/chef_metal/add_prefix_action_handler.rb', line 25

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

#performed_action(description) ⇒ Object



21
22
23
# File 'lib/chef_metal/add_prefix_action_handler.rb', line 21

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

#report_progress(description) ⇒ Object



17
18
19
# File 'lib/chef_metal/add_prefix_action_handler.rb', line 17

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