Class: Spotify::Models::SavedTrack

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ SavedTrack

Returns a new instance of SavedTrack.



9
10
11
12
13
14
15
16
# File 'lib/spotify/models/saved_track.rb', line 9

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

  @track    = Track.new(args[:name])

  # HACK: Using JSON while the other classes aren't available.
  @added_at = args[:added_at]
end

Instance Attribute Details

#added_atObject (readonly)

Returns the value of attribute added_at.



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

def added_at
  @added_at
end

#trackObject (readonly)

Returns the value of attribute track.



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

def track
  @track
end