Class: Svpply::ProductCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/svpply/product_collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ProductCollection

Returns a new instance of ProductCollection.



5
6
7
8
9
# File 'lib/svpply/product_collection.rb', line 5

def initialize(response)
  @products = response["products"].map { |p| Product.new(p) }
  @products_count = response["products_count"]
  self
end

Instance Attribute Details

#productsObject (readonly)

Returns the value of attribute products.



3
4
5
# File 'lib/svpply/product_collection.rb', line 3

def products
  @products
end

#products_countObject (readonly)

Returns the value of attribute products_count.



3
4
5
# File 'lib/svpply/product_collection.rb', line 3

def products_count
  @products_count
end