Class: Spotify::Models::Full::Track

Inherits:
Track
  • Object
show all
Defined in:
lib/spotify/models/full/track.rb

Instance Attribute Summary collapse

Attributes inherited from Track

#artists, #available_markets, #disc_number, #duration_ms, #explicit, #external_urls, #href, #id, #is_playable, #linked_from, #name, #preview_url, #track_number, #type, #uri

Instance Method Summary collapse

Constructor Details

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

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
# File 'lib/spotify/models/full/track.rb', line 16

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

  args = Hash(args).with_indifferent_access

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

  @album        = album
  @external_ids = external_ids
  @popularity   = args[:popularity]
end

Instance Attribute Details

#albumObject (readonly)

Returns the value of attribute album.



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

def album
  @album
end

#external_idsObject (readonly)

Returns the value of attribute external_ids.



7
8
9
# File 'lib/spotify/models/full/track.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/track.rb', line 7

def popularity
  @popularity
end