Sha256: 644c75e1ba0cf7993530cecf7956f94b09932bce3c735e50165509be9ff6d883

Contents?: true

Size: 665 Bytes

Versions: 2

Compression:

Stored size: 665 Bytes

Contents

module MusicBrainz
  class ReleaseGroup < BaseModel
    field :id, String
    field :type, String
    field :title, String
    field :desc, String
    field :first_release_date, Date

    alias_method :disambiguation, :desc

    def releases
      @releases ||= client.load(:release, { release_group: id, inc: [:media], limit: 100 }, {
        binding: :release_group_releases,
        create_models: :release,
        sort: :date
      }) unless @id.nil?
    end

    class << self
      def find(id)
        client.load(:release_group, { id: id }, {
          binding: :release_group,
          create_model: :release_group
        })
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
musicbrainz-0.7.3 lib/musicbrainz/models/release_group.rb
musicbrainz-0.7.2 lib/musicbrainz/models/release_group.rb