Class: Janeway::AST::Boolean
- Inherits:
-
Expression
- Object
- Expression
- Janeway::AST::Boolean
- Defined in:
- lib/janeway/ast/boolean.rb
Overview
Represent keywords true, false
Instance Attribute Summary
Attributes inherited from Expression
Instance Method Summary collapse
-
#literal? ⇒ Boolean
Return true if this is a literal expression.
- #to_s ⇒ Object
- #tree(level) ⇒ Array
Methods inherited from Expression
#indented, #initialize, #singular_query?, #type
Constructor Details
This class inherits a constructor from Janeway::AST::Expression
Instance Method Details
#literal? ⇒ Boolean
Return true if this is a literal expression
19 20 21 |
# File 'lib/janeway/ast/boolean.rb', line 19 def literal? true end |
#to_s ⇒ Object
7 8 9 |
# File 'lib/janeway/ast/boolean.rb', line 7 def to_s @value ? 'true' : 'false' end |
#tree(level) ⇒ Array
13 14 15 |
# File 'lib/janeway/ast/boolean.rb', line 13 def tree(level) [indented(level, to_s)] end |