Class: SWR3::NowPlaying::Song
- Inherits:
-
Object
- Object
- SWR3::NowPlaying::Song
- Defined in:
- lib/swr3_now_playing/song.rb
Instance Attribute Summary collapse
-
#artist ⇒ Object
readonly
Returns the value of attribute artist.
-
#cover ⇒ Object
readonly
Returns the value of attribute cover.
-
#play_date ⇒ Object
Returns the value of attribute play_date.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(artist, title, cover = nil) ⇒ Song
constructor
A new instance of Song.
- #to_s ⇒ Object
Constructor Details
#initialize(artist, title, cover = nil) ⇒ Song
Returns a new instance of Song.
8 9 10 11 12 |
# File 'lib/swr3_now_playing/song.rb', line 8 def initialize(artist, title, cover=nil) @artist = artist @title = title @cover = cover end |
Instance Attribute Details
#artist ⇒ Object (readonly)
Returns the value of attribute artist.
5 6 7 |
# File 'lib/swr3_now_playing/song.rb', line 5 def artist @artist end |
#cover ⇒ Object (readonly)
Returns the value of attribute cover.
5 6 7 |
# File 'lib/swr3_now_playing/song.rb', line 5 def cover @cover end |
#play_date ⇒ Object
Returns the value of attribute play_date.
6 7 8 |
# File 'lib/swr3_now_playing/song.rb', line 6 def play_date @play_date end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/swr3_now_playing/song.rb', line 5 def title @title end |
Instance Method Details
#to_s ⇒ Object
14 15 16 |
# File 'lib/swr3_now_playing/song.rb', line 14 def to_s "#{artist.name}: #{title}" end |