Class: ChefApply::Action::GenerateTempCookbook
- Defined in:
- lib/chef_apply/action/generate_temp_cookbook.rb,
lib/chef_apply/action/generate_temp_cookbook/recipe_lookup.rb,
lib/chef_apply/action/generate_temp_cookbook/temp_cookbook.rb
Direct Known Subclasses
Defined Under Namespace
Classes: RecipeLookup, TempCookbook
Instance Attribute Summary collapse
-
#generated_cookbook ⇒ Object
readonly
Returns the value of attribute generated_cookbook.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(options) ⇒ GenerateTempCookbook
constructor
A new instance of GenerateTempCookbook.
- #perform_action ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(options) ⇒ GenerateTempCookbook
Returns a new instance of GenerateTempCookbook.
36 37 38 39 40 |
# File 'lib/chef_apply/action/generate_temp_cookbook.rb', line 36 def initialize() super() require_relative "generate_temp_cookbook/temp_cookbook" @generated_cookbook ||= TempCookbook.new end |
Instance Attribute Details
#generated_cookbook ⇒ Object (readonly)
Returns the value of attribute generated_cookbook.
22 23 24 |
# File 'lib/chef_apply/action/generate_temp_cookbook.rb', line 22 def generated_cookbook @generated_cookbook end |
Class Method Details
.from_options(opts) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/chef_apply/action/generate_temp_cookbook.rb', line 24 def self.(opts) if opts.key?(:recipe_spec) GenerateCookbookFromRecipe.new(opts) elsif opts.key?(:resource_name) && opts.key?(:resource_type) && opts.key?(:resource_properties) GenerateCookbookFromResource.new(opts) else raise MissingOptions.new(opts) end end |
Instance Method Details
#generate ⇒ Object
48 49 50 |
# File 'lib/chef_apply/action/generate_temp_cookbook.rb', line 48 def generate raise NotImplemented end |
#perform_action ⇒ Object
42 43 44 45 46 |
# File 'lib/chef_apply/action/generate_temp_cookbook.rb', line 42 def perform_action notify(:generating) generate notify(:success) end |