module Access class ProductGroup include Access::MuchMeta def initialize(values) @used_fields = [] set_up_methods(values) set_values(values) # @categories = Access::Category.process_batch(@categories) if @categories # @links = Access::Link.new(@links) if @links # @offer_store = Access::Store.new(@offer_store) if @offer_store # @offer_uses_remaining = Access::Redemption.new(@offer_uses_remaining) if @offer_uses_remaining end def self.search(options = {}) Access::Api.new.search_product_groups options end def self.process_batch(chunk) chunk.map { |product_group| new(product_group) } end end end