Class: Puppet::Parser::AST::Boolean
- Inherits:
-
Leaf
- Object
- Puppet::Parser::AST
- Leaf
- Puppet::Parser::AST::Boolean
- Defined in:
- lib/vendor/puppet/parser/ast/leaf.rb
Overview
The boolean class. True or false. Converts the string it receives to a Ruby boolean.
Constant Summary
Constants inherited from Puppet::Parser::AST
Constants included from Util::Docs
Instance Attribute Summary
Attributes inherited from Leaf
Attributes inherited from Puppet::Parser::AST
Attributes included from Util::Docs
Instance Method Summary collapse
-
#initialize(hash) ⇒ Boolean
constructor
Use the parent method, but then convert to a real boolean.
- #to_s ⇒ Object
Methods inherited from Leaf
Methods inherited from Puppet::Parser::AST
associates_doc, #evaluate, #evaluate_match, #inspect, #parsefail, #parsewrap, #safeevaluate, settor?, #use_docs
Methods included from Util::Docs
#desc, #dochook, #doctable, #markdown_definitionlist, #markdown_header, #nodoc?, #pad, scrub
Methods included from Util::MethodHelper
#requiredopts, #set_options, #symbolize_options
Methods included from Util::Errors
#adderrorcontext, #devfail, #error_context, #exceptwrap, #fail
Constructor Details
#initialize(hash) ⇒ Boolean
Use the parent method, but then convert to a real boolean.
27 28 29 30 31 32 33 34 35 |
# File 'lib/vendor/puppet/parser/ast/leaf.rb', line 27 def initialize(hash) super unless @value == true or @value == false raise Puppet::DevError, "'#{@value}' is not a boolean" end @value end |
Instance Method Details
#to_s ⇒ Object
37 38 39 |
# File 'lib/vendor/puppet/parser/ast/leaf.rb', line 37 def to_s @value ? "true" : "false" end |