Class: JSONP3::Expression
- Inherits:
-
Object
- Object
- JSONP3::Expression
- Defined in:
- lib/json_p3/filter.rb
Overview
Base class for all filter expression nodes.
Direct Known Subclasses
FilterExpression, FilterExpressionLiteral, FunctionExpression, InfixExpression, LogicalNotExpression, QueryExpression
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#evaluate(_context) ⇒ Object
Evaluate the filter expression in the given context.
-
#initialize(token) ⇒ Expression
constructor
A new instance of Expression.
Constructor Details
#initialize(token) ⇒ Expression
Returns a new instance of Expression.
12 13 14 |
# File 'lib/json_p3/filter.rb', line 12 def initialize(token) @token = token end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
10 11 12 |
# File 'lib/json_p3/filter.rb', line 10 def token @token end |
Instance Method Details
#evaluate(_context) ⇒ Object
Evaluate the filter expression in the given context.
17 18 19 |
# File 'lib/json_p3/filter.rb', line 17 def evaluate(_context) raise "filter expressions must implement `evaluate(context)`" end |