Class: SqlQueryExecutor::Operators::Default

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

Instance Method Summary collapse

Constructor Details

#initialize(query, collection) ⇒ Default



6
7
8
9
# File 'lib/sql_query_executor/operators/default.rb', line 6

def initialize(query, collection)
  super
  convert_operator
end

Instance Method Details

#execute!(result) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/sql_query_executor/operators/default.rb', line 11

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

    value.send(@operator, @value) rescue false
  end
end