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

Inherits:
AST
  • Object
show all
Defined in:
lib/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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#typeObject



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

def type
  @type
end

#valueObject



6
7
8
# File 'lib/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/puppet/parser/ast/leaf.rb', line 9

def evaluate(scope)
  @value
end

#match(value) ⇒ Object



13
14
15
# File 'lib/puppet/parser/ast/leaf.rb', line 13

def match(value)
  @value == value
end

#to_sObject



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

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