Class: Beatport::Catalog::Track

Inherits:
Item
  • Object
show all
Defined in:
lib/beatport/catalog/track.rb

Class Method Summary collapse

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 tracks matching the criterea



21
22
23
# File 'lib/beatport/catalog/track.rb', line 21

def self.all(options = {})
  Client.retrieve 'tracks', Track, options
end

.find(key) ⇒ Object

Returns the track with the given id



16
17
18
# File 'lib/beatport/catalog/track.rb', line 16

def self.find(key)
  Client.retrieve 'tracks', Track, :key => key
end


25
26
27
# File 'lib/beatport/catalog/track.rb', line 25

def self.most_popular(options = {})
  Client.retrieve 'most-popular', Track, options
end


35
36
37
38
39
# File 'lib/beatport/catalog/track.rb', line 35

def self.most_popular_for_artist(id, options = {})
  options[:id] = id
  options[:collection] = true
  Client.retrieve "most-popular/artist", Track, options
end


29
30
31
32
33
# File 'lib/beatport/catalog/track.rb', line 29

def self.most_popular_for_genre(id, options = {})
  options[:id] = id
  options[:collection] = true
  Client.retrieve "most-popular/genre", Track, options
end


41
42
43
44
45
# File 'lib/beatport/catalog/track.rb', line 41

def self.most_popular_for_label(id, options = {})
  options[:id] = id
  options[:collection] = true
  Client.retrieve "most-popular/label", Track, options
end