Class: Janeway::AST::Selector
- Inherits:
-
Expression
- Object
- Expression
- Janeway::AST::Selector
- Defined in:
- lib/janeway/ast/selector.rb
Overview
Represent a selector, which is an expression that filters nodes from a list based on a predicate.
www.rfc-editor.org/rfc/rfc9535.html#name-selectors Selectors:
A name selector, e.g. ‘name’, selects a named child of an object.
An index selector, e.g. 3, selects an indexed child of an array.
A wildcard * in the expression [*] selects all children of a node and in the expression ..[*] selects all descendants of a node.
An array slice start:end:step selects a series of elements from an array, giving a start position, an end position, and an optional step value that moves the position from the start to the end.
Filter expressions ?<logical-expr> select certain children of an object or array, as in:
$.store.book[[email protected] < 10].title
Direct Known Subclasses
ArraySliceSelector, DescendantSegment, FilterSelector, IndexSelector, NameSelector, WildcardSelector
Instance Attribute Summary collapse
-
#next ⇒ Object
Subsequent expression that modifies the result of this selector list.
Attributes inherited from Expression
Instance Method Summary collapse
Methods inherited from Expression
#indented, #initialize, #literal?, #singular_query?, #tree, #type
Constructor Details
This class inherits a constructor from Janeway::AST::Expression
Instance Attribute Details
#next ⇒ Object
Subsequent expression that modifies the result of this selector list.
27 28 29 |
# File 'lib/janeway/ast/selector.rb', line 27 def next @next end |
Instance Method Details
#==(other) ⇒ Object
29 30 31 |
# File 'lib/janeway/ast/selector.rb', line 29 def ==(other) value == other&.value end |