Class: Spotify::Models::Full::Artist

Inherits:
Artist
  • Object
show all
Defined in:
lib/spotify/models/full/artist.rb

Instance Attribute Summary collapse

Attributes inherited from Artist

#external_urls, #href, #id, #name, #type, #uri

Instance Method Summary collapse

Constructor Details

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

Sets the arguments to its variables.

Parameters:

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

    the arguments that will be placed on each variable.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/spotify/models/full/artist.rb', line 16

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

  args = Hash(args).with_indifferent_access

  # Arrays

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

  # Objects

  follower = Spotify::Models::Follower.new(args[:followers])

  @followers     = follower
  @genres        = args[:genres]
  @images        = images
  @popularity    = args[:popularity]
end

Instance Attribute Details

#followersObject (readonly)

Returns the value of attribute followers.



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

def followers
  @followers
end

#genresObject (readonly)

Returns the value of attribute genres.



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

def genres
  @genres
end

#imagesObject (readonly)

Returns the value of attribute images.



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

def images
  @images
end

#popularityObject (readonly)

Returns the value of attribute popularity.



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

def popularity
  @popularity
end