Class: Puppet::Parser::AST::Else

Inherits:
Branch show all
Defined in:
lib/puppet/parser/ast/else.rb

Overview

A separate ElseIf statement; can function as an ‘else’ if there’s no test.

Instance Attribute Summary collapse

Attributes inherited from Branch

#children, #pin

Instance Method Summary collapse

Methods inherited from Branch

#initialize

Constructor Details

This class inherits a constructor from Puppet::Parser::AST::Branch

Instance Attribute Details

#statementsObject



10
11
12
# File 'lib/puppet/parser/ast/else.rb', line 10

def statements
  @statements
end

Instance Method Details

#each {|@statements| ... } ⇒ Object

Yields:



12
13
14
# File 'lib/puppet/parser/ast/else.rb', line 12

def each
  yield @statements
end

#evaluate(scope) ⇒ Object

Evaluate the actual statements; this only gets called if our test was true matched.



18
19
20
# File 'lib/puppet/parser/ast/else.rb', line 18

def evaluate(scope)
  @statements.safeevaluate(scope)
end