Sha256: a7c42d895de754cb53366b3dd3e7b02d19a02f8a434fb06c802efb913ac2f0ef

Contents?: true

Size: 847 Bytes

Versions: 4

Compression:

Stored size: 847 Bytes

Contents

module Beatport
  module Catalog
    class Release < Item
      has_many :artists, Artist
      has_one :audio_format_fee, AudioFormatFee
      has_many :genres, Genre
      has_one :images, Images
      has_one :label, Label
      has_one :price, Price
      has_one :recommendations, Recommendations
      has_many :tracks, Track
      has_one :tracks_price, Price

      def discount
        tracks_price - price
      end
    
      def self.find(*args)
        Client.retrieve 'releases', Release, *args
      end

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
beatport-0.2.0 lib/beatport/catalog/release.rb
beatport-0.1.10 lib/beatport/catalog/release.rb
beatport-0.1.9 lib/beatport/catalog/release.rb
beatport-0.1.8 lib/beatport/catalog/release.rb