Class: Access::ProductGroup

Inherits:
Object
  • Object
show all
Includes:
MuchMeta
Defined in:
lib/access/product_group.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from MuchMeta

#set_up_methods, #set_values

Constructor Details

#initialize(values) ⇒ ProductGroup

Returns a new instance of ProductGroup.



13
14
15
16
17
18
# File 'lib/access/product_group.rb', line 13

def initialize(values)
  @used_fields = []
  set_up_methods(values)
  set_values(values)
  @products = Access::Product.process_batch(@products) if @products
end

Class Method Details

.process_batch(chunk) ⇒ Object



9
10
11
# File 'lib/access/product_group.rb', line 9

def self.process_batch(chunk)
  chunk.map { |product_group| new(product_group) }
end

.search(options = {}) ⇒ Object



5
6
7
# File 'lib/access/product_group.rb', line 5

def self.search(options = {})
  Access::Api.new.search_product_groups options
end