Class: Track

Inherits:
Object
  • Object
show all
Defined in:
lib/track.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(track_id, song_data) ⇒ Track

Returns a new instance of Track.



6
7
8
9
10
11
12
13
# File 'lib/track.rb', line 6

def initialize(track_id, song_data)
  @track_id = track_id
  @name = song_data[:name]
  @artist = song_data[:artist]
  @total_time = song_data[:total_time]
  @album = song_data[:album]
  @play_count = song_data[:play_count]
end

Instance Attribute Details

#albumObject

Returns the value of attribute album.



4
5
6
# File 'lib/track.rb', line 4

def album
  @album
end

#artistObject

Returns the value of attribute artist.



4
5
6
# File 'lib/track.rb', line 4

def artist
  @artist
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/track.rb', line 4

def name
  @name
end

#play_countObject

Returns the value of attribute play_count.



4
5
6
# File 'lib/track.rb', line 4

def play_count
  @play_count
end

#total_timeObject

Returns the value of attribute total_time.



4
5
6
# File 'lib/track.rb', line 4

def total_time
  @total_time
end

#track_idObject

Returns the value of attribute track_id.



4
5
6
# File 'lib/track.rb', line 4

def track_id
  @track_id
end