module Hayrick
Constants
- VERSION
Public Class Methods
included(base)
click to toggle source
# File lib/hayrick.rb, line 6 def self.included(base) base.send(:extend, ClassMethods) end
Public Instance Methods
base_scope()
click to toggle source
# File lib/hayrick.rb, line 14 def base_scope fail(NotImplementedError) end
search(params, seed = base_scope)
click to toggle source
# File lib/hayrick.rb, line 10 def search(params, seed = base_scope) params.reduce(seed, &apply_filter) end
Private Instance Methods
apply_filter()
click to toggle source
# File lib/hayrick.rb, line 20 def apply_filter lambda do |accumulated_search, (keyword, term)| lookup_filter(keyword).call(accumulated_search, term) end end
lookup_filter(name)
click to toggle source
# File lib/hayrick.rb, line 26 def lookup_filter(name) self.class.search_filters[name] end