Class: FilterLexer::Filter

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
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

Instance Method Details

#dataObject

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

#identifierObject

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

#operatorObject

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_stringObject



27
28
29
# File 'lib/filter_lexer/formatters/sql.rb', line 27

def query_string
	return "#{identifier.sql} #{operator.sql} ?"
end

#query_variablesObject



31
32
33
# File 'lib/filter_lexer/formatters/sql.rb', line 31

def query_variables
	return [data.data]
end