Class: Spotify::Models::Album

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

Direct Known Subclasses

Full::Album, Simplified::Album

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ 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
# File 'lib/spotify/models/album.rb', line 17

def initialize(args = {})
  args = Hash(args).with_indifferent_access

  # Arrays
  images = Array(args[:images]).map { |i| Spotify::Models::Image.new(i) }

  # Objects
  external_urls = Spotify::Models::ExternalURL.new(args[:external_urls])

  @album_type             = args[:album_type]
  @available_markets      = args[:available_markets]
  @external_urls          = external_urls
  @genres                 = args[:genres]
  @href                   = args[:href]
  @id                     = args[:id]
  @images                 = images
  @name                   = args[:name]
  @type                   = args[:type]
  @uri                    = args[:uri]
end

Instance Attribute Details

#album_typeObject (readonly)

Returns the value of attribute album_type.



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

def album_type
  @album_type
end

#available_marketsObject (readonly)

Returns the value of attribute available_markets.



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

def available_markets
  @available_markets
end

#external_urlsObject (readonly)

Returns the value of attribute external_urls.



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

def external_urls
  @external_urls
end

#genresObject (readonly)

Returns the value of attribute genres.



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

def genres
  @genres
end

#hrefObject (readonly)

Returns the value of attribute href.



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

def href
  @href
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#imagesObject (readonly)

Returns the value of attribute images.



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

def images
  @images
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

#uriObject (readonly)

Returns the value of attribute uri.



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

def uri
  @uri
end