Class: Access::Aggregations

Inherits:
Object
  • Object
show all
Includes:
MuchMeta
Defined in:
lib/access/aggregations.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from MuchMeta

#set_up_methods, #set_values

Constructor Details

#initialize(values) ⇒ Aggregations

Returns a new instance of Aggregations.



9
10
11
12
13
14
15
# File 'lib/access/aggregations.rb', line 9

def initialize(values)
  @used_fields = []
  set_up_methods(values)
  set_values(values)
  @subcategories = Access::Category.process_batch(@subcategories) if @subcategories
  @facets = Access::Aggregations.process_batch(@facets) if @facets
end

Class Method Details

.process_batch(chunk) ⇒ Object



5
6
7
# File 'lib/access/aggregations.rb', line 5

def self.process_batch(chunk)
  chunk.map { |aggs| new(aggs) }
end