Class: Postrocktues::Track

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#trackObject (readonly)

Returns the value of attribute track.



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

def track
  @track
end

Instance Method Details

#albumObject



18
19
20
# File 'lib/postrocktues/track.rb', line 18

def album
  track.album.name
end

#artistObject



14
15
16
# File 'lib/postrocktues/track.rb', line 14

def artist
  track.artist.name
end

#nameObject



10
11
12
# File 'lib/postrocktues/track.rb', line 10

def name
  track.name
end

#to_sObject



30
31
32
# File 'lib/postrocktues/track.rb', line 30

def to_s
  "#{track.name} by #{track.artist.name} (#{track.album.name})"
end

#uriObject



22
23
24
# File 'lib/postrocktues/track.rb', line 22

def uri
  track.to_link.to_uri
end

#urlObject



26
27
28
# File 'lib/postrocktues/track.rb', line 26

def url
  track.to_link.to_url
end