summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast/else.rb
blob: 17214911655e15065a359e2bf6d9c0acabedbdcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'puppet/parser/ast/branch'

class Puppet::Parser::AST
  # A separate ElseIf statement; can function as an 'else' if there's no
  # test.
  class Else < AST::Branch

    associates_doc

    attr_accessor :statements

    def each
      yield @statements
    end

    # Evaluate the actual statements; this only gets called if
    # our test was true matched.
    def evaluate(scope)
      @statements.safeevaluate(scope)
    end
  end
end