Class: ChefMetal::ActionHandler
- Inherits:
-
Object
- Object
- ChefMetal::ActionHandler
- Defined in:
- lib/chef_metal/action_handler.rb
Instance Method Summary collapse
-
#debug_name ⇒ Object
This is the name that will show up in the output, so should be something like a cookbook or driver name.
-
#perform_action(description, &block) ⇒ Object
This should perform the actual action (e.g., converge) if there is an action that needs to be done.
-
#recipe_context ⇒ Object
This should be the run context.
-
#updated! ⇒ Object
This should be repaced with whatever records the update; by default it essentially does nothing here.
Instance Method Details
#debug_name ⇒ Object
This is the name that will show up in the output, so should be something like a cookbook or driver name
45 46 47 |
# File 'lib/chef_metal/action_handler.rb', line 45 def debug_name raise ActionFailed, "ActionHandler behavior requires a debug_name" end |
#perform_action(description, &block) ⇒ Object
This should perform the actual action (e.g., converge) if there is an action that needs to be done.
By default, it will simply execute the block as so:
38 39 40 41 |
# File 'lib/chef_metal/action_handler.rb', line 38 def perform_action(description, &block) puts description block.call end |
#recipe_context ⇒ Object
This should be the run context
24 25 26 |
# File 'lib/chef_metal/action_handler.rb', line 24 def recipe_context raise ActionFailed, "ActionHandler behavior requires a recipe_context" end |
#updated! ⇒ Object
This should be repaced with whatever records the update; by default it essentially does nothing here.
30 31 32 |
# File 'lib/chef_metal/action_handler.rb', line 30 def updated! @updated = true end |