Class: Track
- Inherits:
-
Object
- Object
- Track
- Defined in:
- lib/track.rb
Instance Attribute Summary collapse
-
#album ⇒ Object
Returns the value of attribute album.
-
#artist ⇒ Object
Returns the value of attribute artist.
-
#name ⇒ Object
Returns the value of attribute name.
-
#play_count ⇒ Object
Returns the value of attribute play_count.
-
#total_time ⇒ Object
Returns the value of attribute total_time.
-
#track_id ⇒ Object
Returns the value of attribute track_id.
Instance Method Summary collapse
-
#initialize(track_id, song_data) ⇒ Track
constructor
A new instance of Track.
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
#album ⇒ Object
Returns the value of attribute album.
4 5 6 |
# File 'lib/track.rb', line 4 def album @album end |
#artist ⇒ Object
Returns the value of attribute artist.
4 5 6 |
# File 'lib/track.rb', line 4 def artist @artist end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/track.rb', line 4 def name @name end |
#play_count ⇒ Object
Returns the value of attribute play_count.
4 5 6 |
# File 'lib/track.rb', line 4 def play_count @play_count end |
#total_time ⇒ Object
Returns the value of attribute total_time.
4 5 6 |
# File 'lib/track.rb', line 4 def total_time @total_time end |
#track_id ⇒ Object
Returns the value of attribute track_id.
4 5 6 |
# File 'lib/track.rb', line 4 def track_id @track_id end |