Class: Query::Node::Operator
- Inherits:
-
Query::Node
- Object
- Query::Node
- Query::Node::Operator
- Defined in:
- lib/query/node/operator.rb
Constant Summary collapse
- OPERATORS =
{ "^" => "^", "$" => "$", ">=" => ">=", "=>" => ">=", "<=" => "<=", "=<" => "<=", "<" => "<", ">" => ">", "!" => "!", ":::" => ":", "::" => ":", ":" => ":", "=" => "=", "==" => "=", "===" => "=", }
Instance Attribute Summary collapse
-
#operator ⇒ Object
Returns the value of attribute operator.
Instance Method Summary collapse
- #evaluate(**args) ⇒ Object
-
#initialize(parsed) ⇒ Operator
constructor
A new instance of Operator.
Constructor Details
#initialize(parsed) ⇒ Operator
Returns a new instance of Operator.
26 27 28 |
# File 'lib/query/node/operator.rb', line 26 def initialize(parsed) self.operator = parsed end |
Instance Attribute Details
#operator ⇒ Object
Returns the value of attribute operator.
6 7 8 |
# File 'lib/query/node/operator.rb', line 6 def operator @operator end |
Instance Method Details
#evaluate(**args) ⇒ Object
30 31 32 |
# File 'lib/query/node/operator.rb', line 30 def evaluate(**args) OPERATORS.fetch(operator) end |