Class: MundaneSearch::Filters::Operator

Inherits:
Typical show all
Defined in:
lib/mundane-search/filters/operator.rb

Direct Known Subclasses

ActiveRecord

Defined Under Namespace

Classes: ActiveRecord

Instance Attribute Summary

Attributes inherited from Base

#collection, #options, #params

Instance Method Summary collapse

Methods inherited from Typical

#apply?, #key, key_type, #key_type, key_types, #match_value, #optional?, #target

Methods inherited from Base

#apply?, #call, #filtered_params, #initialize

Constructor Details

This class inherits a constructor from MundaneSearch::Filters::Base

Instance Method Details

#filtered_collectionObject



9
10
11
# File 'lib/mundane-search/filters/operator.rb', line 9

def filtered_collection
  collection.select {|e| e.send(target).send(operator, match_value) }
end

#operatorObject



13
14
15
# File 'lib/mundane-search/filters/operator.rb', line 13

def operator
  options[:operator]
end