Class: Song

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#lyricsObject

Returns the value of attribute lyrics.



5
6
7
# File 'lib/song.rb', line 5

def lyrics
  @lyrics
end

#titleObject

Returns the value of attribute title.



6
7
8
# File 'lib/song.rb', line 6

def title
  @title
end