Class: Puppet::Parser::AST::ResourceReference
- Defined in:
- lib/puppet/parser/ast/resource_reference.rb
Instance Attribute Summary collapse
Attributes inherited from Branch
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
Constructor Details
This class inherits a constructor from Puppet::Parser::AST::Branch
Instance Attribute Details
#title ⇒ Object
5 6 7 |
# File 'lib/puppet/parser/ast/resource_reference.rb', line 5 def title @title end |
#type ⇒ Object
5 6 7 |
# File 'lib/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/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 |