class Toller::Filter
Attributes
parameter[R]
properties[R]
type[R]
Public Class Methods
new(parameter, type, options)
click to toggle source
# File lib/toller/filter.rb, line 10 def initialize(parameter, type, options) @parameter = parameter @type = type @properties = options.reverse_merge( field: parameter, default: false, scope_name: nil ) end
Public Instance Methods
apply!(collection, value)
click to toggle source
# File lib/toller/filter.rb, line 20 def apply!(collection, value) if type == :scope Filters::ScopeHandler.new.call(collection, value, properties) else Filters::WhereHandler.new.call(collection, type, value, properties) end end
default()
click to toggle source
# File lib/toller/filter.rb, line 28 def default properties[:default] end