Class: Eson::Search::Facets::FacetArray

Inherits:
Array
  • Object
show all
Includes:
Parametrized
Defined in:
lib/eson/search/facets.rb

Instance Attribute Summary

Attributes included from Parametrized

#args

Instance Method Summary collapse

Methods included from Parametrized

#param

Constructor Details

#initialize(args) ⇒ FacetArray

Returns a new instance of FacetArray.



7
8
9
10
# File 'lib/eson/search/facets.rb', line 7

def initialize(args)
  self.args = args
  instance_exec(self, &Proc.new) if block_given?
end

Instance Method Details

#to_query_hashObject



12
13
14
15
16
17
18
19
# File 'lib/eson/search/facets.rb', line 12

def to_query_hash
  h = {}
  self.each do |k,v|
    h[k] = v.to_query_hash
    h[k][:scope] = v.scope_name if v.scope_name
  end
  h
end