Class: Hario::FilterParser
- Inherits:
-
Object
- Object
- Hario::FilterParser
- Includes:
- ParserUtils
- Defined in:
- lib/hario/behaviours/filter.rb
Constant Summary collapse
- OPERATORS =
{ lt: '<', gt: '>', lte: '<=', gte: '>=', like: 'like', equals: '=', is: 'is' }
- IS_VALUES =
{ null: 'NULL', not_null: 'NOT NULL' }
- InvalidValueError =
Class.new(RuntimeError)
Constants included from ParserUtils
ParserUtils::InvalidAttributeError
Instance Attribute Summary collapse
-
#join_clause ⇒ Object
Returns the value of attribute join_clause.
-
#where_clauses ⇒ Object
Returns the value of attribute where_clauses.
Instance Method Summary collapse
-
#initialize(filters, klass) ⇒ FilterParser
constructor
A new instance of FilterParser.
Methods included from ParserUtils
#end_model_from_association_chain, #raise_if_unlisted_attribute!, #table_name_from_association_chain
Constructor Details
#initialize(filters, klass) ⇒ FilterParser
Returns a new instance of FilterParser.
12 13 14 15 16 17 |
# File 'lib/hario/behaviours/filter.rb', line 12 def initialize(filters, klass) @filters = filters @klass = klass parse_filters end |
Instance Attribute Details
#join_clause ⇒ Object
Returns the value of attribute join_clause.
10 11 12 |
# File 'lib/hario/behaviours/filter.rb', line 10 def join_clause @join_clause end |
#where_clauses ⇒ Object
Returns the value of attribute where_clauses.
10 11 12 |
# File 'lib/hario/behaviours/filter.rb', line 10 def where_clauses @where_clauses end |