Class: ElVallenato::Letra
- Inherits:
-
Object
- Object
- ElVallenato::Letra
- Defined in:
- lib/elvallenato/letra.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Instance Method Summary collapse
- #artist ⇒ Object
- #body ⇒ Object
- #composer ⇒ Object
-
#initialize(content) ⇒ Letra
constructor
A new instance of Letra.
- #title ⇒ Object
Constructor Details
#initialize(content) ⇒ Letra
Returns a new instance of Letra.
8 9 10 11 |
# File 'lib/elvallenato/letra.rb', line 8 def initialize(content) @content = content @doc = Nokogiri::HTML(@content) end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
6 7 8 |
# File 'lib/elvallenato/letra.rb', line 6 def content @content end |
Instance Method Details
#artist ⇒ Object
25 26 27 |
# File 'lib/elvallenato/letra.rb', line 25 def artist @artist ||= @doc.search("td .text_std")[8].text end |
#body ⇒ Object
17 18 19 |
# File 'lib/elvallenato/letra.rb', line 17 def body @body ||= @doc.search("td .text_std")[6].inner_html end |
#composer ⇒ Object
21 22 23 |
# File 'lib/elvallenato/letra.rb', line 21 def composer @composer ||= @doc.search("td .text_std")[9].text end |
#title ⇒ Object
13 14 15 |
# File 'lib/elvallenato/letra.rb', line 13 def title @title ||= @doc.at(".text_title").text end |