Method: Elasticated::QueryAggregations#parse

Defined in:
lib/elasticated/query_aggregations.rb

#parse(response) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/elasticated/query_aggregations.rb', line 22

def parse(response)
  _aggregations.inject({}) do |hash, aggregation|
    name = aggregation.name.to_s
    original_name = aggregation.original_name.to_s
    hash.merge original_name => aggregation.parse(response[name])
  end
end