Class: SqlQueryExecutor::Operators::Between
- Inherits:
-
Base
- Object
- Base
- SqlQueryExecutor::Operators::Between
show all
- Defined in:
- lib/sql_query_executor/operators/between.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#logic(is_hash = false) ⇒ Object
11
12
13
14
15
|
# File 'lib/sql_query_executor/operators/between.rb', line 11
def logic(is_hash=false)
initialize_attributes(true)
"#{field(is_hash)} >= #{@value[0]} && #{field(is_hash)} <= #{@value[1]}"
end
|
#selector ⇒ Object
6
7
8
9
|
# File 'lib/sql_query_executor/operators/between.rb', line 6
def selector
initialize_attributes
{ @field => { "$gte" => @value.first, "$lte" => @value.last }}
end
|