Class: SqlQueryExecutor::Operators::Default

Inherits:
Base
  • Object
show all
Defined in:
lib/sql_query_executor/operators/default.rb

Constant Summary collapse

SELECTORS =
{
  "=="      => nil,
  ">"       => "$gt",
  "<"       => "$lt",
  ">="      => "$gte",
  "<="      => "$lte",
  "!="      => "$ne"
}

Instance Method Summary collapse

Methods inherited from Base

#initialize, #logic

Constructor Details

This class inherits a constructor from SqlQueryExecutor::Operators::Base

Instance Method Details

#selectorObject



15
16
17
18
19
20
21
# File 'lib/sql_query_executor/operators/default.rb', line 15

def selector
  initialize_attributes

  operator = SELECTORS[@operator]

  { @field => operator ? {operator => @value} : @value}
end