Class: Puppet::Parser::AST::Boolean

Inherits:
Leaf show all
Defined in:
lib/puppet/parser/ast/leaf.rb

Overview

The boolean class. True or false. Converts the string it receives to a Ruby boolean.

Instance Attribute Summary

Attributes inherited from Leaf

#type, #value

Instance Method Summary collapse

Methods inherited from Leaf

#evaluate, #match, #to_s

Constructor Details

#initialize(hash) ⇒ Boolean

Returns a new instance of Boolean.



25
26
27
28
29
30
31
32
# File 'lib/puppet/parser/ast/leaf.rb', line 25

def initialize(hash)
  super

  unless @value == true or @value == false
    raise Puppet::DevError, "'#{@value}' is not a boolean"
  end
  @value
end