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.

API:

  • public

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#typeObject

API:

  • public



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

def type
  @type
end

#valueObject

API:

  • public



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.

API:

  • public



9
10
11
# File 'lib/puppet/parser/ast/leaf.rb', line 9

def evaluate(scope)
  @value
end

#match(value) ⇒ Object

API:

  • public



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

def match(value)
  @value == value
end

#to_sObject

API:

  • public



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

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