Class: Honeysearch::SongData
- Inherits:
-
Object
- Object
- Honeysearch::SongData
- Defined in:
- lib/honeysearch.rb
Instance Method Summary collapse
- #artist ⇒ Object
- #genre ⇒ Object
-
#initialize(rawdata) ⇒ SongData
constructor
A new instance of SongData.
- #inspect ⇒ Object
- #lyrics ⇒ Object
- #number ⇒ Object
- #splitdata ⇒ Object
- #tieup ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(rawdata) ⇒ SongData
57 58 59 |
# File 'lib/honeysearch.rb', line 57 def initialize(rawdata) @rawdata = rawdata end |
Instance Method Details
#artist ⇒ Object
71 72 73 |
# File 'lib/honeysearch.rb', line 71 def artist splitdata[0] end |
#genre ⇒ Object
91 92 93 |
# File 'lib/honeysearch.rb', line 91 def genre splitdata[5] end |
#inspect ⇒ Object
95 96 97 |
# File 'lib/honeysearch.rb', line 95 def inspect "#<SongData: #{number} (#{artist}, #{title})>" end |
#lyrics ⇒ Object
83 84 85 |
# File 'lib/honeysearch.rb', line 83 def lyrics splitdata[3] end |
#number ⇒ Object
79 80 81 |
# File 'lib/honeysearch.rb', line 79 def number splitdata[2] end |
#splitdata ⇒ Object
61 62 63 64 65 66 67 68 69 |
# File 'lib/honeysearch.rb', line 61 def splitdata @splitdata ||= begin res = [] @rawdata.scan(%r{<li>(?<text>.+?)</li>}) do |x| res << x.first end res end end |
#tieup ⇒ Object
87 88 89 |
# File 'lib/honeysearch.rb', line 87 def tieup splitdata[4] end |
#title ⇒ Object
75 76 77 |
# File 'lib/honeysearch.rb', line 75 def title splitdata[1] end |