Class: Lyricfy::Song
- Inherits:
-
Object
- Object
- Lyricfy::Song
- Defined in:
- lib/lyricfy/song.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#lines ⇒ Object
Returns the value of attribute lines.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #body(separator = '\n') ⇒ Object
-
#initialize(title, author, lines) ⇒ Song
constructor
A new instance of Song.
Constructor Details
#initialize(title, author, lines) ⇒ Song
Returns a new instance of Song.
5 6 7 8 9 |
# File 'lib/lyricfy/song.rb', line 5 def initialize(title, , lines) self.title = title self. = self.lines = lines end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
3 4 5 |
# File 'lib/lyricfy/song.rb', line 3 def @author end |
#lines ⇒ Object
Returns the value of attribute lines.
3 4 5 |
# File 'lib/lyricfy/song.rb', line 3 def lines @lines end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/lyricfy/song.rb', line 3 def title @title end |
Instance Method Details
#body(separator = '\n') ⇒ Object
11 12 13 |
# File 'lib/lyricfy/song.rb', line 11 def body(separator = '\n') lines.join(separator) end |