Class: Puppet::Parser::AST::Minus
Instance Attribute Summary collapse
Attributes inherited from Branch
#children, #pin
Instance Method Summary
collapse
Methods inherited from Branch
#initialize
Instance Attribute Details
8
9
10
|
# File 'lib/puppet/parser/ast/minus.rb', line 8
def value
@value
end
|
Instance Method Details
#each {|@value| ... } ⇒ Object
10
11
12
|
# File 'lib/puppet/parser/ast/minus.rb', line 10
def each
yield @value
end
|
#evaluate(scope) ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/puppet/parser/ast/minus.rb', line 14
def evaluate(scope)
val = @value.safeevaluate(scope)
val = Puppet::Parser::Scope.number?(val)
if val == nil
raise ArgumentError, "minus operand #{val} is not a number"
end
-val
end
|