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.50 lib/access/aggregations.rb
access-2.0.49 lib/access/aggregations.rb
access-2.0.48 lib/access/aggregations.rb
access-2.0.47 lib/access/aggregations.rb
access-2.0.46 lib/access/aggregations.rb
access-2.0.44 lib/access/aggregations.rb
access-2.0.43 lib/access/aggregations.rb
access-2.0.42 lib/access/aggregations.rb
access-2.0.41 lib/access/aggregations.rb
access-2.0.40 lib/access/aggregations.rb
access-2.0.39 lib/access/aggregations.rb
access-2.0.38 lib/access/aggregations.rb
access-2.0.37 lib/access/aggregations.rb
access-2.0.36 lib/access/aggregations.rb
access-2.0.34 lib/access/aggregations.rb
access-2.0.33 lib/access/aggregations.rb
access-2.0.32 lib/access/aggregations.rb
access-2.0.31 lib/access/aggregations.rb
access-2.0.30 lib/access/aggregations.rb
access-2.0.29 lib/access/aggregations.rb