Class: FilterLexer::Filter

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/filter_lexer/nodes.rb,
lib/filter_lexer/formatters/sql.rb

Overview

A filter is the core object of the lexer: an indentifier, an operator and a data

Instance Method Summary collapse

Instance Method Details

#dataObject

The value element

Subclass of FilterLexer::Value



29
30
31
# File 'lib/filter_lexer/nodes.rb', line 29

def data
	return elements[2]
end

#identifierObject

The identifier element

Of type FilterLexer::Identifier



15
16
17
# File 'lib/filter_lexer/nodes.rb', line 15

def identifier
	return elements[0]
end

#operatorObject

The operator element

Subclass of FilterLexer::Operator



22
23
24
# File 'lib/filter_lexer/nodes.rb', line 22

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.sql]
end