Class: Eson::Search::Histogram

Inherits:
Object
  • Object
show all
Includes:
Facet
Defined in:
lib/eson/search/histogram.rb

Direct Known Subclasses

DateHistogram

Instance Attribute Summary collapse

Attributes included from Facet

#args, #scope_name

Instance Method Summary collapse

Methods included from Facet

included, #method_missing, #param, #scope

Constructor Details

#initialize(options = {}) ⇒ Histogram

Returns a new instance of Histogram.



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

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::Facet

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



9
10
11
# File 'lib/eson/search/histogram.rb', line 9

def options
  @options
end

Instance Method Details

#histogram { ... } ⇒ self

Generates a ‘histogram` facet in a facets context.

Yields:

  • the block describing further options

Returns:

  • (self)

    the generated facet



7
# File 'lib/eson/search/histogram.rb', line 7

short_name :histogram

#to_query_hashObject



15
16
17
# File 'lib/eson/search/histogram.rb', line 15

def to_query_hash
  {name => options}
end