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

# An object that returns a boolean which is the boolean not
# of the given value.
class Puppet::Parser::AST
    class Not < AST::Branch
        attr_accessor :value

        def each
            yield @value
        end

        def evaluate(scope)
            val = @value.safeevaluate(scope)
            return ! Puppet::Parser::Scope.true?(val)
        end
    end
end