Class: Janeway::AST::Boolean

Inherits:
Expression show all
Defined in:
lib/janeway/ast/boolean.rb

Overview

Represent keywords true, false

Instance Attribute Summary

Attributes inherited from Expression

#next, #value

Instance Method Summary collapse

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

Returns:



19
20
21
# File 'lib/janeway/ast/boolean.rb', line 19

def literal?
  true
end

#to_sObject



7
8
9
# File 'lib/janeway/ast/boolean.rb', line 7

def to_s
  @value ? 'true' : 'false'
end

#tree(level) ⇒ Array

Parameters:

  • level (Integer)

Returns:

  • (Array)


13
14
15
# File 'lib/janeway/ast/boolean.rb', line 13

def tree(level)
  [indented(level, to_s)]
end