Class: Beatport::Catalog::Genre
- Defined in:
- lib/beatport/catalog/genre.rb
Class Method Summary collapse
-
.all(options = {}) ⇒ Object
Returns all the genres.
-
.find(key) ⇒ Object
Returns the genre with the given id or slug.
- .overview ⇒ Object
Instance Method Summary collapse
-
#slideshow ⇒ Object
Returns the slideshow for the genre.
-
#top_downloads ⇒ Object
Returns the top downloads for the genre.
Methods inherited from Item
#[], #associate, associations, find_by_name, has_many, has_one, #id, #initialize, lazy_accessor, #type
Constructor Details
This class inherits a constructor from Beatport::Item
Class Method Details
.all(options = {}) ⇒ Object
Returns all the genres
17 18 19 |
# File 'lib/beatport/catalog/genre.rb', line 17 def self.all( = {}) Client.retrieve 'genres', Genre, end |
.find(key) ⇒ Object
Returns the genre with the given id or slug
12 13 14 |
# File 'lib/beatport/catalog/genre.rb', line 12 def self.find(key) Client.retrieve 'genres', Genre, :key => key, :string_key_type => :slug, :subgenres => true end |
.overview ⇒ Object
21 22 23 |
# File 'lib/beatport/catalog/genre.rb', line 21 def self.overview Client.retrieve 'genres/overview', Genre end |
Instance Method Details
#slideshow ⇒ Object
Returns the slideshow for the genre
31 32 33 |
# File 'lib/beatport/catalog/genre.rb', line 31 def ||= Slideshow.find(id) end |
#top_downloads ⇒ Object
Returns the top downloads for the genre
26 27 28 |
# File 'lib/beatport/catalog/genre.rb', line 26 def top_downloads @top_downloads ||= Track.most_popular_for_genre(id) end |