Class: NodeQuery::Compiler::Boolean

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/node_query/compiler/boolean.rb

Overview

Boolean represents a ruby boolean value.

Constant Summary

Constants included from Comparable

Comparable::ARRAY_VALID_OPERATORS, Comparable::NUMBER_VALID_OPERATORS, Comparable::REGEXP_VALID_OPERATORS, Comparable::SIMPLE_VALID_OPERATORS, Comparable::STRING_VALID_OPERATORS

Instance Method Summary collapse

Methods included from Comparable

#actual_value, #expected_value, #is_equal?, #match?, #valid_operator?

Constructor Details

#initialize(value:) ⇒ Boolean

Initialize a Boolean.

Parameters:

  • value (Boolean)

    the boolean value



10
11
12
# File 'lib/node_query/compiler/boolean.rb', line 10

def initialize(value:)
  @value = value
end

Instance Method Details

#to_sObject



20
21
22
# File 'lib/node_query/compiler/boolean.rb', line 20

def to_s
  @value.to_s
end

#valid_operatorsArray

Get valid operators.

Returns:

  • (Array)

    valid operators



16
17
18
# File 'lib/node_query/compiler/boolean.rb', line 16

def valid_operators
  SIMPLE_VALID_OPERATORS
end