Class: DDQL::TokenType::Query
- Inherits:
-
Operator
- Object
- DDQL::TokenType
- Operator
- DDQL::TokenType::Query
- Defined in:
- lib/ddql/token_type.rb
Constant Summary
Constants inherited from Operator
Constants inherited from DDQL::TokenType
ALL, CURRENCY_LITERAL, FACTOR, FACTOR_PATTERN, INFIXOPERATOR, INTEGER_LITERAL, LBRACE, LPAREN, NESTED_CLOSER, NESTED_CLOSE_PATTERN, NESTED_OPENER, NESTED_OPEN_PATTERN, NUMERIC_LITERAL, POSTFIXOPERATOR, PREFIXOPERATOR, RBRACE, RPAREN, SCI_NUM_LITERAL, SCREEN, SPECIAL_MARKER, STRING_LITERAL, SUB_Q_ALIAS, SUB_Q_EXPR, SUB_Q_FIELDS, SUB_Q_GROUP, SUB_Q_TYPE, WHITESPACE
Instance Attribute Summary
Attributes inherited from DDQL::TokenType
Instance Method Summary collapse
- #as_hash(data) ⇒ Object
- #expression? ⇒ Boolean
-
#initialize ⇒ Query
constructor
A new instance of Query.
Methods inherited from Operator
#comparison?, #complex_comparison?, #math?, #parse, #simple_comparison?
Methods inherited from DDQL::TokenType
#==, all_types_pattern, #comparison?, #data_from, #factor?, #group?, #infix?, #interpret, #interpreted_data_from, #literal?, #match?, #parse, #postfix?, #prefix?, #screen?, #skipping!, #supports_post_processing?, #trimming!
Constructor Details
#initialize ⇒ Query
Returns a new instance of Query.
371 372 373 |
# File 'lib/ddql/token_type.rb', line 371 def initialize super(name: :query, pattern: /(?<=\{)(?<subquery>[^{}]+)(?=\{|\})/) end |
Instance Method Details
#as_hash(data) ⇒ Object
375 376 377 378 379 |
# File 'lib/ddql/token_type.rb', line 375 def as_hash(data) _initialize if @sub_query_pattern.nil? tokens = Lexer.lex(data, pattern: @sub_query_pattern, available_types: @parts) {agg: {op_is: 'IS'}, right: {null_value_type: data.split(' ').last}} end |
#expression? ⇒ Boolean
381 382 383 |
# File 'lib/ddql/token_type.rb', line 381 def expression? true end |