Class: JSONP3::QueryExpression
Overview
Base class for all embedded filter queries
Instance Attribute Summary collapse
Attributes inherited from Expression
#token
Instance Method Summary
collapse
Constructor Details
Returns a new instance of QueryExpression.
296
297
298
299
|
# File 'lib/json_p3/filter.rb', line 296
def initialize(token, query)
super(token)
@query = query
end
|
Instance Attribute Details
#query ⇒ Object
Returns the value of attribute query.
294
295
296
|
# File 'lib/json_p3/filter.rb', line 294
def query
@query
end
|
Instance Method Details
#==(other) ⇒ Object
Also known as:
eql?
309
310
311
312
313
|
# File 'lib/json_p3/filter.rb', line 309
def ==(other)
self.class == other.class &&
@query == other.query &&
@token == other.token
end
|
#evaluate(_context) ⇒ Object
301
302
303
|
# File 'lib/json_p3/filter.rb', line 301
def evaluate(_context)
raise "query expressions must implement `evaluate(context)`"
end
|
#hash ⇒ Object
317
318
319
|
# File 'lib/json_p3/filter.rb', line 317
def hash
[@query, @token].hash
end
|
#to_s ⇒ Object
305
306
307
|
# File 'lib/json_p3/filter.rb', line 305
def to_s
raise "query expressions must implement `to_s`"
end
|