Class: Puppet::Parser::AST::ResourceReference
- Inherits:
-
Branch
- Object
- Puppet::Parser::AST
- Branch
- Puppet::Parser::AST::ResourceReference
- Defined in:
- lib/vendor/puppet/parser/ast/resource_reference.rb
Constant Summary
Constants inherited from Puppet::Parser::AST
Constants included from Util::Docs
Instance Attribute Summary collapse
-
#title ⇒ Object
Returns the value of attribute title.
-
#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
Evaluate our object, but just return a simple array of the type and name.
- #to_s ⇒ Object
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
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/vendor/puppet/parser/ast/resource_reference.rb', line 5 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/vendor/puppet/parser/ast/resource_reference.rb', line 5 def type @type end |
Instance Method Details
#evaluate(scope) ⇒ Object
Evaluate our object, but just return a simple array of the type and name.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/vendor/puppet/parser/ast/resource_reference.rb', line 9 def evaluate(scope) titles = Array(title.safeevaluate(scope)).flatten a_type, titles = scope.resolve_type_and_titles(type, titles) resources = titles.collect{ |a_title| Puppet::Resource.new(a_type, a_title) } return(resources.length == 1 ? resources.pop : resources) end |