Class: Namarara::BoolValue
- Defined in:
- lib/namarara/parser.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Attributes inherited from TreeValue
Instance Method Summary collapse
- #compute ⇒ Object
-
#initialize(str) ⇒ BoolValue
constructor
A new instance of BoolValue.
- #to_s ⇒ Object
Constructor Details
#initialize(str) ⇒ BoolValue
Returns a new instance of BoolValue.
81 82 83 84 85 86 87 |
# File 'lib/namarara/parser.rb', line 81 def initialize(str) @errors = [] @value = case str when /true/i then true when /false/i then false end end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
79 80 81 |
# File 'lib/namarara/parser.rb', line 79 def errors @errors end |
Instance Method Details
#compute ⇒ Object
89 90 91 |
# File 'lib/namarara/parser.rb', line 89 def compute @value end |
#to_s ⇒ Object
93 94 95 |
# File 'lib/namarara/parser.rb', line 93 def to_s "bool:#{@value}" end |