Class: Puppet::Parser::AST::ResourceDefaults
- Inherits:
-
Branch
- Object
- Puppet::Parser::AST
- Branch
- Puppet::Parser::AST::ResourceDefaults
- Defined in:
- lib/vendor/puppet/parser/ast/resource_defaults.rb
Overview
A statement syntactically similar to an ResourceDef, but uses a capitalized object type and cannot have a name.
Constant Summary
Constants inherited from Puppet::Parser::AST
Constants included from Util::Docs
Instance Attribute Summary collapse
-
#parameters ⇒ Object
Returns the value of attribute parameters.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from Branch
Attributes inherited from Puppet::Parser::AST
Attributes included from Util::Docs
Instance Method Summary collapse
-
#evaluate(scope) ⇒ Object
As opposed to ResourceDef, this stores each default for the given object type.
Methods inherited from Branch
Methods inherited from Puppet::Parser::AST
associates_doc, #evaluate_match, #initialize, #inspect, #parsefail, #parsewrap, #safeevaluate, settor?, #use_docs
Methods included from Util::Docs
#desc, #dochook, #doctable, #markdown_definitionlist, #markdown_header, #nodoc?, #pad, scrub
Methods included from Util::MethodHelper
#requiredopts, #set_options, #symbolize_options
Methods included from Util::Errors
#adderrorcontext, #devfail, #error_context, #exceptwrap, #fail
Constructor Details
This class inherits a constructor from Puppet::Parser::AST::Branch
Instance Attribute Details
#parameters ⇒ Object
Returns the value of attribute parameters.
7 8 9 |
# File 'lib/vendor/puppet/parser/ast/resource_defaults.rb', line 7 def parameters @parameters end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/vendor/puppet/parser/ast/resource_defaults.rb', line 7 def type @type end |
Instance Method Details
#evaluate(scope) ⇒ Object
As opposed to ResourceDef, this stores each default for the given object type.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/vendor/puppet/parser/ast/resource_defaults.rb', line 13 def evaluate(scope) # Use a resource reference to canonize the type ref = Puppet::Resource.new(@type, "whatever") type = ref.type params = @parameters.safeevaluate(scope) parsewrap do scope.setdefaults(type, params) end end |