Class: Spotify::Album

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/spotify.rb

Overview

Internal: Represents an album.

Direct Known Subclasses

Track

Instance Method Summary collapse

Instance Method Details

#artistObject

Public: Gets the artist of artists.

Returns an Array of Spotify::Artist objects or a Spotify::Artist object if only one artist was returned.



124
125
126
127
128
129
130
131
132
# File 'lib/spotify.rb', line 124

def artist
  if artists.nil?
    Artist.new :name => super
  elsif artists.size > 1
    artists
  else
    artists.first
  end
end

#artistsObject

Public: Gets the artists.

Returns an Array of Spotify::Artist objects.



116
117
118
# File 'lib/spotify.rb', line 116

def artists
  super.nil? ? super : super.map { |artist| Artist.new artist }
end