Class: Eson::Search::Ids

Inherits:
Object
  • Object
show all
Includes:
Filter, Query
Defined in:
lib/eson/search/ids.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Query

included, #method_missing

Methods included from Filter

included, #method_missing

Constructor Details

#initialize(*args) ⇒ Ids

Returns a new instance of Ids.



13
14
15
16
17
18
19
20
21
22
# File 'lib/eson/search/ids.rb', line 13

def initialize(*args)
  if args.length == 2
    self.options = {
      :type => args.first,
      :values => args.last
    }
  else
    self.options = args.first
  end
end

Dynamic Method Handling

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

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



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

def options
  @options
end

Instance Method Details

#ids { ... } ⇒ self #ids { ... } ⇒ self

Overloads:

  • #ids { ... } ⇒ self

    Generates a ‘ids` filter in a filter context.

    Yields:

    • the block containing further options and subfilters

    Returns:

    • (self)

      the generated facet

  • #ids { ... } ⇒ self

    Generates a ‘ids` query in a query context.

    Yields:

    • the block containing further options and subqueries

    Returns:

    • (self)

      the generated facet



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

short_name :ids