Class: ActiveMocker::Collection::Queries::WhereNotChain

Inherits:
Object
  • Object
show all
Defined in:
lib/active_mocker/collection/queries.rb

Instance Method Summary collapse

Constructor Details

#initialize(collection) ⇒ WhereNotChain

Returns a new instance of WhereNotChain.



30
31
32
# File 'lib/active_mocker/collection/queries.rb', line 30

def initialize(collection)
  @collection = collection
end

Instance Method Details

#not(options = {}) ⇒ Object



34
35
36
37
38
# File 'lib/active_mocker/collection/queries.rb', line 34

def not(options={})
  @collection.reject do |record|
    options.all? { |col, match| record.send(col) == match }
  end
end