Class: SqlQueryExecutor::Operators::Between

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

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

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

#selectorObject



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