Module: Goodyear::FilterMethods

Included in:
QueryMethods
Defined in:
lib/goodyear/filter_methods.rb

Instance Method Summary collapse

Instance Method Details

#filter(name, options = {}, &block) ⇒ Object



3
4
5
6
7
# File 'lib/goodyear/filter_methods.rb', line 3

def filter(name, options = {}, &block)
  @_filters ||= []
  @_filters << {name: name, args: options, l: block}
  return self
end

#has_field?(field) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
# File 'lib/goodyear/filter_methods.rb', line 9

def has_field?(field)
  filter :exists, {field: field}
  return self
end

#query_filter(name, options = {}) ⇒ Object



14
15
16
17
18
# File 'lib/goodyear/filter_methods.rb', line 14

def query_filter(name,  options = {})
  @_query_filters ||= []
  @_query_filters << {name: name,  options: options}
  self
end