Class: JSONP3::Path::FilterExpressionLiteral
- Inherits:
-
Expression
- Object
- Expression
- JSONP3::Path::FilterExpressionLiteral
- Defined in:
- lib/json_p3/path/filter.rb
Overview
Base class for expression literals.
Direct Known Subclasses
BooleanLiteral, FloatLiteral, IntegerLiteral, NullLiteral, StringLiteral
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Expression
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #evaluate(_context) ⇒ Object
- #hash ⇒ Object
-
#initialize(token, value) ⇒ FilterExpressionLiteral
constructor
A new instance of FilterExpressionLiteral.
- #to_s ⇒ Object
Constructor Details
#initialize(token, value) ⇒ FilterExpressionLiteral
Returns a new instance of FilterExpressionLiteral.
91 92 93 94 |
# File 'lib/json_p3/path/filter.rb', line 91 def initialize(token, value) super(token) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
89 90 91 |
# File 'lib/json_p3/path/filter.rb', line 89 def value @value end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
104 105 106 107 108 |
# File 'lib/json_p3/path/filter.rb', line 104 def ==(other) self.class == other.class && @value == other.value && @token == other.token end |
#evaluate(_context) ⇒ Object
96 97 98 |
# File 'lib/json_p3/path/filter.rb', line 96 def evaluate(_context) @value end |
#hash ⇒ Object
112 113 114 |
# File 'lib/json_p3/path/filter.rb', line 112 def hash [@value, @token].hash end |
#to_s ⇒ Object
100 101 102 |
# File 'lib/json_p3/path/filter.rb', line 100 def to_s @value.to_s end |