Class: Song
- Inherits:
-
Object
- Object
- Song
- Defined in:
- lib/song.rb
Instance Attribute Summary collapse
-
#lyrics ⇒ Object
Returns the value of attribute lyrics.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(nokogiriDoc) ⇒ Song
constructor
A new instance of Song.
Constructor Details
#initialize(nokogiriDoc) ⇒ Song
Returns a new instance of Song.
8 9 10 11 12 13 |
# File 'lib/song.rb', line 8 def initialize(nokogiriDoc) if nokogiriDoc @lyrics = nokogiriDoc.css("textarea")[0].inner_text @title = nokogiriDoc.css("h2")[0].inner_text end end |
Instance Attribute Details
#lyrics ⇒ Object
Returns the value of attribute lyrics.
5 6 7 |
# File 'lib/song.rb', line 5 def lyrics @lyrics end |
#title ⇒ Object
Returns the value of attribute title.
6 7 8 |
# File 'lib/song.rb', line 6 def title @title end |