diff options
Diffstat (limited to 'lib/puppet/parser/ast/not.rb')
-rw-r--r-- | lib/puppet/parser/ast/not.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/puppet/parser/ast/not.rb b/lib/puppet/parser/ast/not.rb new file mode 100644 index 000000000..c8fa1df2c --- /dev/null +++ b/lib/puppet/parser/ast/not.rb @@ -0,0 +1,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 |