Class: Song

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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(author, title)
  @author = author
  @title = title
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



2
3
4
# File 'lib/lyrics_finder/song.rb', line 2

def author
  @author
end

#titleObject

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.author = I18n.transliterate(@author.strip.gsub(" ", separator))
  self.title = I18n.transliterate(@title.strip.gsub(" ", separator))
end