Sha256: d50449fc970562608ba1a8a57669d79ddd3d93f5fe4d6ffdaf21492935b97ff8
Contents?: true
Size: 516 Bytes
Versions: 40
Compression:
Stored size: 516 Bytes
Contents
module Access class Aggregations def self.process_batch(chunk) chunk.map { |aggs| new(aggs) } end def initialize(values) self.class.class_eval {attr_reader *values.keys } values.each do |attribute_name, attribute_value| self.instance_variable_set("@#{attribute_name}", attribute_value) end @subcategories = Access::Category.process_batch(@subcategories) if @subcategories @facets = Access::Aggregations.process_batch(@facets) if @facets end end end
Version data entries
40 entries across 40 versions & 1 rubygems