Class: Song
- Inherits:
-
Object
- Object
- Song
- Defined in:
- lib/lyrics_finder/song.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #format_attributes_with_separator!(separator) ⇒ Object
-
#initialize(author, title) ⇒ Song
constructor
A new instance of Song.
Constructor Details
#initialize(author, title) ⇒ Song
Returns a new instance of Song.
4 5 6 7 |
# File 'lib/lyrics_finder/song.rb', line 4 def initialize(, title) @author = @title = title end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
2 3 4 |
# File 'lib/lyrics_finder/song.rb', line 2 def @author end |
#title ⇒ Object
Returns the value of attribute title.
2 3 4 |
# File 'lib/lyrics_finder/song.rb', line 2 def title @title end |
Instance Method Details
#format_attributes_with_separator!(separator) ⇒ Object
9 10 11 12 |
# File 'lib/lyrics_finder/song.rb', line 9 def format_attributes_with_separator!(separator) self. = I18n.transliterate(@author.strip.gsub(" ", separator)) self.title = I18n.transliterate(@title.strip.gsub(" ", separator)) end |