Class: Beatport::Catalog::Release

Inherits:
Item
  • Object
show all
Includes:
Support::Url
Defined in:
lib/beatport/catalog/release.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Support::Url

#url

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



24
25
26
# File 'lib/beatport/catalog/release.rb', line 24

def self.all(options={})
  Client.retrieve 'releases', Release, options
end


28
29
30
# File 'lib/beatport/catalog/release.rb', line 28

def self.featured(*args)
  Client.retrieve 'featured/releases', Release, *args
end

.find(*args) ⇒ Object



20
21
22
# File 'lib/beatport/catalog/release.rb', line 20

def self.find(*args)
  Client.retrieve 'releases', Release, *args
end

Instance Method Details

#discountObject



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

def discount
  tracks_price - price
end

#tracks(options = {}) ⇒ Object



32
33
34
35
# File 'lib/beatport/catalog/release.rb', line 32

def tracks(options = {})
  options[:release_id] = id
  Track.all(options)
end