Sha256: 138b37bdc180316c6267d420e2ad4699ceace850fd8d3a9fcb5074b292ef7b9d

Contents?: true

Size: 861 Bytes

Versions: 5

Compression:

Stored size: 861 Bytes

Contents

module Beatport
  module Catalog
    class Release < Item
      include Support::Url

      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

5 entries across 5 versions & 1 rubygems

Version Path
beatport-0.4.0 lib/beatport/catalog/release.rb
beatport-0.3.0 lib/beatport/catalog/release.rb
beatport-0.2.3 lib/beatport/catalog/release.rb
beatport-0.2.2 lib/beatport/catalog/release.rb
beatport-0.2.1 lib/beatport/catalog/release.rb