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

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

Overview

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

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 Branch

#children, #pin

Attributes inherited from Puppet::Parser::AST

#file, #line, #parent, #scope

Attributes included from Util::Docs

#doc, #nodoc

Instance Method Summary collapse

Methods inherited from Branch

#initialize

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::Branch

Instance Attribute Details

#statementsObject

Returns the value of attribute statements.



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

def statements
  @statements
end

Instance Method Details

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

Yields:



12
13
14
# File 'lib/vendor/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/vendor/puppet/parser/ast/else.rb', line 18

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