Class: Svpply::ProductCollection
- Inherits:
-
Object
- Object
- Svpply::ProductCollection
- Defined in:
- lib/svpply/product_collection.rb
Instance Attribute Summary collapse
-
#products ⇒ Object
readonly
Returns the value of attribute products.
-
#products_count ⇒ Object
readonly
Returns the value of attribute products_count.
Instance Method Summary collapse
-
#initialize(response) ⇒ ProductCollection
constructor
A new instance of ProductCollection.
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
#products ⇒ Object (readonly)
Returns the value of attribute products.
3 4 5 |
# File 'lib/svpply/product_collection.rb', line 3 def products @products end |
#products_count ⇒ Object (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 |