Class: Eson::Search::Or

Inherits:
Object
  • Object
show all
Includes:
Filter, Filters, FilterMethods
Defined in:
lib/eson/search/or.rb

Instance Attribute Summary collapse

Attributes included from Filters

#filters

Instance Method Summary collapse

Methods included from Filter

included, #method_missing

Methods included from Filters

#filters?, register

Constructor Details

#initialize(options = {}) ⇒ Or

Returns a new instance of Or.



13
14
15
# File 'lib/eson/search/or.rb', line 13

def initialize(options = {})
  self.options = options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Eson::Search::Filter

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



11
12
13
# File 'lib/eson/search/or.rb', line 11

def options
  @options
end

Instance Method Details

#or { ... } ⇒ self

Generates a ‘or` filter in a filter context.

Yields:

  • the block containing further options and subfilters

Returns:

  • (self)

    the generated facet



9
# File 'lib/eson/search/or.rb', line 9

short_name 'or'

#to_query_hashObject



17
18
19
# File 'lib/eson/search/or.rb', line 17

def to_query_hash
  { name => filters.to_query_hash }
end