Class: Spotify::Models::User
- Inherits:
-
Object
- Object
- Spotify::Models::User
- Defined in:
- lib/spotify/models/user.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
-
#external_urls ⇒ Object
readonly
Returns the value of attribute external_urls.
-
#followers ⇒ Object
readonly
Returns the value of attribute followers.
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ User
constructor
Sets the arguments to its variables.
Constructor Details
#initialize(args = {}) ⇒ User
Sets the arguments to its variables.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/spotify/models/user.rb', line 17 def initialize(args = {}) args = Hash(args).with_indifferent_access # Array images = Array(args[:images]).map { |i| Spotify::Models::Image.new(i) } # Objects external_urls = Spotify::Models::ExternalURL.new(args[:external_urls]) follower = Spotify::Models::Follower.new(args[:followers]) @display_name = args[:display_name] @external_urls = external_urls @followers = follower @href = args[:href] @id = args[:id] @images = images @type = args[:type] @uri = args[:uri] end |
Instance Attribute Details
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
7 8 9 |
# File 'lib/spotify/models/user.rb', line 7 def display_name @display_name end |
#external_urls ⇒ Object (readonly)
Returns the value of attribute external_urls.
7 8 9 |
# File 'lib/spotify/models/user.rb', line 7 def external_urls @external_urls end |
#followers ⇒ Object (readonly)
Returns the value of attribute followers.
7 8 9 |
# File 'lib/spotify/models/user.rb', line 7 def followers @followers end |
#href ⇒ Object (readonly)
Returns the value of attribute href.
7 8 9 |
# File 'lib/spotify/models/user.rb', line 7 def href @href end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/spotify/models/user.rb', line 7 def id @id end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
7 8 9 |
# File 'lib/spotify/models/user.rb', line 7 def images @images end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/spotify/models/user.rb', line 7 def type @type end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
7 8 9 |
# File 'lib/spotify/models/user.rb', line 7 def uri @uri end |