Class: Grin::Category
Constant Summary
Constants inherited from Client
Grin::Client::API_VERSION, Grin::Client::DOMAIN
Instance Method Summary collapse
- #albums ⇒ Object
- #destroy ⇒ Object
-
#initialize(data) ⇒ Category
constructor
A new instance of Category.
Methods inherited from Client
#album, #categories, #category, #create_album, #create_category, #find_or_create_album, #find_or_create_category
Constructor Details
Instance Method Details
#albums ⇒ Object
13 14 15 16 17 |
# File 'lib/grin/category.rb', line 13 def albums albums = [] get('albums.json').select { |album| album['category']['id'] == id }.each { |album| albums << Album.new(album) } return albums end |
#destroy ⇒ Object
19 20 21 |
# File 'lib/grin/category.rb', line 19 def destroy delete("categories/#{id}.json") end |