Class: SqlQueryExecutor::Operators::In

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

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Instance Method Details

#execute!Object



6
7
8
9
10
11
12
# File 'lib/sql_query_executor/operators/in.rb', line 6

def execute!
  result = @collection.select do |record|
    value = record.send(@field)

    @value.send('include?', value)
  end
end

#selectorObject



14
15
16
# File 'lib/sql_query_executor/operators/in.rb', line 14

def selector
  { @field => { "$in" => @value }}
end