lib/meta-spotify/track.rb in meta-spotify-0.1.3 vs lib/meta-spotify/track.rb in meta-spotify-0.1.4
- old
+ new
@@ -5,9 +5,10 @@
attr_reader :album, :artists, :track_number, :length
def initialize(hash)
@name = hash['name']
+ @uri = hash['href'] if hash.has_key? 'href'
@popularity = hash['popularity'].to_f if hash.has_key? 'popularity'
if hash.has_key? 'artist'
@artists = []
if hash['artist'].is_a? Array
hash['artist'].each { |a| @artists << Artist.new(a) }
\ No newline at end of file