Class: Svpply::CategoryCollection
- Inherits:
-
Object
- Object
- Svpply::CategoryCollection
- Defined in:
- lib/svpply/category_collection.rb
Instance Attribute Summary collapse
-
#categories ⇒ Object
readonly
Returns the value of attribute categories.
Instance Method Summary collapse
-
#initialize(response) ⇒ CategoryCollection
constructor
A new instance of CategoryCollection.
Constructor Details
#initialize(response) ⇒ CategoryCollection
Returns a new instance of CategoryCollection.
5 6 7 8 |
# File 'lib/svpply/category_collection.rb', line 5 def initialize(response) @categories = response["categories"][0]["children"].map { |c| Category.new(c) } self end |
Instance Attribute Details
#categories ⇒ Object (readonly)
Returns the value of attribute categories.
3 4 5 |
# File 'lib/svpply/category_collection.rb', line 3 def categories @categories end |