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.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(artist, title) ⇒ Song
constructor
A new instance of Song.
- #to_s ⇒ Object
Constructor Details
#initialize(artist, title) ⇒ Song
Returns a new instance of Song.
7 8 9 10 |
# File 'lib/swr3_now_playing/song.rb', line 7 def initialize(artist, title) @artist = artist @title = title 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 |
#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
#==(other) ⇒ Object
12 13 14 15 |
# File 'lib/swr3_now_playing/song.rb', line 12 def ==(other) return false if other.nil? self.artist == other.artist && self.title == other.title end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/swr3_now_playing/song.rb', line 17 def to_s "#{@artist}: #{@title}" end |