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