Class: Puppet::Parser::AST::Leaf
- Inherits:
-
Puppet::Parser::AST
- Object
- Puppet::Parser::AST
- Puppet::Parser::AST::Leaf
- Defined in:
- lib/vendor/puppet/parser/ast/leaf.rb
Overview
The base class for all of the leaves of the parse trees. These basically just have types and values. Both of these parameters are simple values, not AST objects.
Direct Known Subclasses
ASTHash, Boolean, ClassName, Concat, Default, FlatString, HashOrArrayAccess, HostName, Name, Nop, Regex, String, Type, Undef
Constant Summary
Constants inherited from Puppet::Parser::AST
Constants included from Util::Docs
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Puppet::Parser::AST
Attributes included from Util::Docs
Instance Method Summary collapse
-
#evaluate(scope) ⇒ Object
Return our value.
- #match(value) ⇒ Object
- #to_s ⇒ Object
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
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/vendor/puppet/parser/ast/leaf.rb', line 6 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/vendor/puppet/parser/ast/leaf.rb', line 6 def value @value end |
Instance Method Details
#evaluate(scope) ⇒ Object
Return our value.
9 10 11 |
# File 'lib/vendor/puppet/parser/ast/leaf.rb', line 9 def evaluate(scope) @value end |
#match(value) ⇒ Object
13 14 15 |
# File 'lib/vendor/puppet/parser/ast/leaf.rb', line 13 def match(value) @value == value end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/vendor/puppet/parser/ast/leaf.rb', line 17 def to_s @value.to_s unless @value.nil? end |