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

Version Path
access-2.0.28 lib/access/aggregations.rb
access-2.0.27 lib/access/aggregations.rb
access-2.0.26 lib/access/aggregations.rb
access-2.0.25 lib/access/aggregations.rb
access-2.0.24 lib/access/aggregations.rb
access-2.0.23 lib/access/aggregations.rb
access-2.0.22 lib/access/aggregations.rb
access-2.0.21 lib/access/aggregations.rb
access-2.0.20 lib/access/aggregations.rb
access-2.0.19 lib/access/aggregations.rb
access-2.0.18 lib/access/aggregations.rb
access-2.0.17 lib/access/aggregations.rb
access-2.0.15 lib/access/aggregations.rb
access-2.0.14 lib/access/aggregations.rb
access-2.0.13 lib/access/aggregations.rb
access-2.0.11 lib/access/aggregations.rb
access-2.0.10 lib/access/aggregations.rb
access-2.0.9 lib/access/aggregations.rb
access-2.0.8 lib/access/aggregations.rb
access-2.0.7 lib/access/aggregations.rb