Class: SWR3::NowPlaying::Song

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#artistObject (readonly)

Returns the value of attribute artist.



5
6
7
# File 'lib/swr3_now_playing/song.rb', line 5

def artist
  @artist
end

#coverObject (readonly)

Returns the value of attribute cover.



5
6
7
# File 'lib/swr3_now_playing/song.rb', line 5

def cover
  @cover
end

#play_dateObject

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

#titleObject (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_sObject



14
15
16
# File 'lib/swr3_now_playing/song.rb', line 14

def to_s
  "#{artist.name}: #{title}"
end