Class: Beatport::Catalog::Release

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

Class Method Summary collapse

Instance 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



22
23
24
# File 'lib/beatport/catalog/release.rb', line 22

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


26
27
28
# File 'lib/beatport/catalog/release.rb', line 26

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

.find(*args) ⇒ Object



18
19
20
# File 'lib/beatport/catalog/release.rb', line 18

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

Instance Method Details

#discountObject



14
15
16
# File 'lib/beatport/catalog/release.rb', line 14

def discount
  tracks_price - price
end

#tracks(options = {}) ⇒ Object



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

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