Class: Lyricfy::Song

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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, author, lines)
  self.title  = title
  self.author = author
  self.lines  = lines
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



3
4
5
# File 'lib/lyricfy/song.rb', line 3

def author
  @author
end

#linesObject

Returns the value of attribute lines.



3
4
5
# File 'lib/lyricfy/song.rb', line 3

def lines
  @lines
end

#titleObject

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