Method: RSpotify::Album#initialize
- Defined in:
- lib/rspotify/album.rb
#initialize(options = {}) ⇒ Album
Returns a new instance of Album.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/rspotify/album.rb', line 74 def initialize( = {}) @album_type = ['album_type'] @available_markets = ['available_markets'] @copyrights = ['copyrights'] @external_ids = ['external_ids'] @genres = ['genres'] @images = ['images'] @label = ['label'] @name = ['name'] @popularity = ['popularity'] @release_date = ['release_date'] @release_date_precision = ['release_date_precision'] @artists = if ['artists'] ['artists'].map { |a| Artist.new a } end @tracks_cache, @total_tracks = if ['tracks'] && ['tracks']['items'] [ ['tracks']['items'].map { |i| Track.new i }, ['tracks']['total'] ] end super() end |