Class: Svpply::CategoryCollection

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#categoriesObject (readonly)

Returns the value of attribute categories.



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

def categories
  @categories
end