Class: JsonQuery::BooleanAtom

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/json_query/nodes.rb

Instance Method Summary collapse

Instance Method Details

#comparatorObject



125
126
127
# File 'lib/json_query/nodes.rb', line 125

def comparator
  elements[1].comparator
end

#firstObject



129
130
131
# File 'lib/json_query/nodes.rb', line 129

def first
  elements[1].first
end

#secondObject



133
134
135
# File 'lib/json_query/nodes.rb', line 133

def second
  elements[1].second
end

#value(root, symbols, current = nil) ⇒ Object



119
120
121
122
123
# File 'lib/json_query/nodes.rb', line 119

def value(root, symbols, current = nil)
  element = elements[1]
  return element.boolean_expression.value(root, symbols, current) if element.respond_to?(:boolean_expression)
  comparator.value(first.value(root, symbols, current), second.value(root, symbols, current))
end