Class: Postrocktues::Track
- Inherits:
-
Object
- Object
- Postrocktues::Track
- Defined in:
- lib/postrocktues/track.rb
Instance Attribute Summary collapse
-
#track ⇒ Object
readonly
Returns the value of attribute track.
Instance Method Summary collapse
- #album ⇒ Object
- #artist ⇒ Object
-
#initialize(track_obj) ⇒ Track
constructor
A new instance of Track.
- #name ⇒ Object
- #to_s ⇒ Object
- #uri ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(track_obj) ⇒ Track
Returns a new instance of Track.
6 7 8 |
# File 'lib/postrocktues/track.rb', line 6 def initialize track_obj @track = track_obj end |
Instance Attribute Details
#track ⇒ Object (readonly)
Returns the value of attribute track.
4 5 6 |
# File 'lib/postrocktues/track.rb', line 4 def track @track end |
Instance Method Details
#album ⇒ Object
18 19 20 |
# File 'lib/postrocktues/track.rb', line 18 def album track.album.name end |
#artist ⇒ Object
14 15 16 |
# File 'lib/postrocktues/track.rb', line 14 def artist track.artist.name end |
#name ⇒ Object
10 11 12 |
# File 'lib/postrocktues/track.rb', line 10 def name track.name end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/postrocktues/track.rb', line 30 def to_s "#{track.name} by #{track.artist.name} (#{track.album.name})" end |
#uri ⇒ Object
22 23 24 |
# File 'lib/postrocktues/track.rb', line 22 def uri track.to_link.to_uri end |
#url ⇒ Object
26 27 28 |
# File 'lib/postrocktues/track.rb', line 26 def url track.to_link.to_url end |