Class: MusicBrainz::Release

Inherits:
BaseModel show all
Defined in:
lib/musicbrainz/models/release.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

inherited

Class Method Details

.find(id) ⇒ Object



24
25
26
27
28
29
# File 'lib/musicbrainz/models/release.rb', line 24

def find(id)
  client.load(:release, { id: id, inc: [:media, :release_groups] }, {
    binding: :release,
    create_model: :release
  })
end

.find_by_discid(id) ⇒ Object



31
32
33
34
35
36
# File 'lib/musicbrainz/models/release.rb', line 31

def find_by_discid(id)
  client.load(:discid, { id: id }, {
    binding: :discid_releases,
    create_models: :release
  })
end

Instance Method Details

#tracksObject



15
16
17
18
19
20
21
# File 'lib/musicbrainz/models/release.rb', line 15

def tracks
  @tracks ||= client.load(:release, { id: id, inc: [:recordings, :media], limit: 100 }, {
    binding: :release_tracks,
    create_models: :track,
    sort: :position
  }) unless @id.nil?
end