Class: Spotify::Models::Full::Album

Inherits:
Album
  • Object
show all
Defined in:
lib/spotify/models/full/album.rb

Instance Attribute Summary collapse

Attributes inherited from Album

#album_type, #available_markets, #external_urls, #genres, #href, #id, #images, #name, #type, #uri

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Full::Album

Sets the arguments to its variables.

Parameters:

  • args (Hash) (defaults to: {})

    the arguments that will be placed on each variable.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/spotify/models/full/album.rb', line 17

def initialize(args = {})
  super(args)

  args = Hash(args).with_indifferent_access

  # Arrays
  artists    = Array(args[:artists]).map    { |a| Artist.new(a)    }
  copyrights = Array(args[:copyrights]).map { |c| Copyright.new(c) }

  # Objects
  external_ids = Spotify::Models::ExternalID.new(args[:external_ids])

  # Paging items
  item   = Spotify::Models::Simplified::Track
  tracks = Spotify::Models::Paging.new(args[:tracks], item)

  @artists                = artists
  @copyrights             = copyrights
  @external_ids           = external_ids
  @popularity             = args[:popularity]
  @release_date           = args[:release_date]
  @release_date_precision = args[:release_date_precision]
  @tracks                 = tracks
end

Instance Attribute Details

#artistsObject (readonly)

Returns the value of attribute artists.



7
8
9
# File 'lib/spotify/models/full/album.rb', line 7

def artists
  @artists
end

#copyrightsObject (readonly)

Returns the value of attribute copyrights.



7
8
9
# File 'lib/spotify/models/full/album.rb', line 7

def copyrights
  @copyrights
end

#external_idsObject (readonly)

Returns the value of attribute external_ids.



7
8
9
# File 'lib/spotify/models/full/album.rb', line 7

def external_ids
  @external_ids
end

#popularityObject (readonly)

Returns the value of attribute popularity.



7
8
9
# File 'lib/spotify/models/full/album.rb', line 7

def popularity
  @popularity
end

#release_dateObject (readonly)

Returns the value of attribute release_date.



7
8
9
# File 'lib/spotify/models/full/album.rb', line 7

def release_date
  @release_date
end

#release_date_precisionObject (readonly)

Returns the value of attribute release_date_precision.



7
8
9
# File 'lib/spotify/models/full/album.rb', line 7

def release_date_precision
  @release_date_precision
end

#tracksObject (readonly)

Returns the value of attribute tracks.



7
8
9
# File 'lib/spotify/models/full/album.rb', line 7

def tracks
  @tracks
end