Class: Dapp::Dimg::Config::Directive::Chef
- Inherits:
-
Base
- Object
- Config::Base
- Config::Directive::Base
- Base
- Dapp::Dimg::Config::Directive::Chef
- Defined in:
- lib/dapp/dimg/config/directive/chef.rb
Defined Under Namespace
Classes: Attributes
Instance Attribute Summary collapse
-
#_attributes ⇒ Object
Returns the value of attribute _attributes.
-
#_cookbook ⇒ Object
Returns the value of attribute _cookbook.
-
#_dimod ⇒ Object
Returns the value of attribute _dimod.
-
#_recipe ⇒ Object
Returns the value of attribute _recipe.
Instance Method Summary collapse
- #attributes ⇒ Object
- #cookbook(name, version_constraint = nil, **kwargs) ⇒ Object
- #dimod(name, *args) ⇒ Object
-
#initialize(**kwargs, &blk) ⇒ Chef
constructor
A new instance of Chef.
- #recipe(name) ⇒ Object
Constructor Details
#initialize(**kwargs, &blk) ⇒ Chef
Returns a new instance of Chef.
8 9 10 11 12 13 14 |
# File 'lib/dapp/dimg/config/directive/chef.rb', line 8 def initialize(**kwargs, &blk) @_dimod = [] @_recipe = [] @_cookbook = {} super(**kwargs, &blk) end |
Instance Attribute Details
#_attributes ⇒ Object
Returns the value of attribute _attributes.
6 7 8 |
# File 'lib/dapp/dimg/config/directive/chef.rb', line 6 def _attributes @_attributes end |
#_cookbook ⇒ Object
Returns the value of attribute _cookbook.
6 7 8 |
# File 'lib/dapp/dimg/config/directive/chef.rb', line 6 def _cookbook @_cookbook end |
#_dimod ⇒ Object
Returns the value of attribute _dimod.
6 7 8 |
# File 'lib/dapp/dimg/config/directive/chef.rb', line 6 def _dimod @_dimod end |
#_recipe ⇒ Object
Returns the value of attribute _recipe.
6 7 8 |
# File 'lib/dapp/dimg/config/directive/chef.rb', line 6 def _recipe @_recipe end |
Instance Method Details
#attributes ⇒ Object
25 26 27 |
# File 'lib/dapp/dimg/config/directive/chef.rb', line 25 def attributes @_attributes ||= Attributes.new end |
#cookbook(name, version_constraint = nil, **kwargs) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/dapp/dimg/config/directive/chef.rb', line 29 def cookbook(name, version_constraint=nil, **kwargs) @_cookbook[name] = {}.tap do |desc| desc.update(kwargs) desc[:name] = name desc[:version_constraint] = version_constraint if version_constraint desc[:path] = File.(desc[:path], dapp.path) if desc.key? :path end end |
#dimod(name, *args) ⇒ Object
16 17 18 19 |
# File 'lib/dapp/dimg/config/directive/chef.rb', line 16 def dimod(name, *args) @_dimod << name cookbook(name, *args) end |
#recipe(name) ⇒ Object
21 22 23 |
# File 'lib/dapp/dimg/config/directive/chef.rb', line 21 def recipe(name) @_recipe << name end |