Class: FilterLexer::Filter
- Inherits:
-
Treetop::Runtime::SyntaxNode
- Object
- Treetop::Runtime::SyntaxNode
- FilterLexer::Filter
- Defined in:
- lib/filter_lexer/nodes/filter.rb,
lib/filter_lexer/formatters/sql.rb
Overview
A filter is the core object of the lexer: an indentifier, an relational operator and data
Instance Method Summary collapse
-
#data ⇒ Object
The data element.
-
#identifier ⇒ Object
The identifier element.
-
#operator ⇒ Object
The operator element.
- #query_string ⇒ Object
- #query_variables ⇒ Object
Instance Method Details
#data ⇒ Object
The data element
Subclass of FilterLexer::Literal
21 22 23 |
# File 'lib/filter_lexer/nodes/filter.rb', line 21 def data return elements[2] end |
#identifier ⇒ Object
The identifier element
Of type FilterLexer::Identifier
7 8 9 |
# File 'lib/filter_lexer/nodes/filter.rb', line 7 def identifier return elements[0] end |
#operator ⇒ Object
The operator element
Subclass of FilterLexer::RelationalOperator
14 15 16 |
# File 'lib/filter_lexer/nodes/filter.rb', line 14 def operator return elements[1] end |
#query_string ⇒ Object
27 28 29 |
# File 'lib/filter_lexer/formatters/sql.rb', line 27 def query_string return "#{identifier.sql} #{operator.sql} ?" end |
#query_variables ⇒ Object
31 32 33 |
# File 'lib/filter_lexer/formatters/sql.rb', line 31 def query_variables return [data.data] end |