Class: Chef::Knife::StencilFile
- Inherits:
-
Object
- Object
- Chef::Knife::StencilFile
- Includes:
- StencilBase, JSON
- Defined in:
- lib/chef/knife/stencil_file.rb
Overview
Objects of this class represent the contents of your various stencil files
Instance Attribute Summary collapse
-
#inherits ⇒ Object
Returns the value of attribute inherits.
-
#matches ⇒ Object
Returns the value of attribute matches.
-
#options ⇒ Object
Returns the value of attribute options.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path, options = {}) ⇒ StencilFile
constructor
A new instance of StencilFile.
Methods included from StencilBase
#build_plugin_klass, #explain, #invoked_as_stencil?, #locate_config_value, #normalize_path, #stencil_root
Constructor Details
#initialize(path, options = {}) ⇒ StencilFile
Returns a new instance of StencilFile.
32 33 34 35 36 37 38 39 40 |
# File 'lib/chef/knife/stencil_file.rb', line 32 def initialize(path, ={}) deserialized = JSON.parse(IO.read(path), :symbolize_names => true) @path = normalize_path(path, stencil_root) @options = deserialized[:options] || [] @inherits = deserialized[:inherits] || [] @matches = deserialized[:matches] || nil end |
Instance Attribute Details
#inherits ⇒ Object
Returns the value of attribute inherits.
30 31 32 |
# File 'lib/chef/knife/stencil_file.rb', line 30 def inherits @inherits end |
#matches ⇒ Object
Returns the value of attribute matches.
30 31 32 |
# File 'lib/chef/knife/stencil_file.rb', line 30 def matches @matches end |
#options ⇒ Object
Returns the value of attribute options.
30 31 32 |
# File 'lib/chef/knife/stencil_file.rb', line 30 def @options end |
#path ⇒ Object
Returns the value of attribute path.
30 31 32 |
# File 'lib/chef/knife/stencil_file.rb', line 30 def path @path end |