Class: Puppet::Parser::AST::Leaf

Inherits:
Puppet::Parser::AST show all
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.

Constant Summary

Constants inherited from Puppet::Parser::AST

AST

Constants included from Util::Docs

Util::Docs::HEADER_LEVELS

Instance Attribute Summary collapse

Attributes inherited from Puppet::Parser::AST

#file, #line, #parent, #scope

Attributes included from Util::Docs

#doc, #nodoc

Instance Method Summary collapse

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

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/vendor/puppet/parser/ast/leaf.rb', line 6

def type
  @type
end

#valueObject

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_sObject



17
18
19
# File 'lib/vendor/puppet/parser/ast/leaf.rb', line 17

def to_s
  @value.to_s unless @value.nil?
end