Class: Opensaz::GeneralInfo
- Inherits:
-
Object
- Object
- Opensaz::GeneralInfo
- Defined in:
- lib/opensaz/general_info.rb
Instance Method Summary collapse
-
#initialize(content) ⇒ GeneralInfo
constructor
A new instance of GeneralInfo.
- #to_a ⇒ Object
Constructor Details
#initialize(content) ⇒ GeneralInfo
Returns a new instance of GeneralInfo.
5 6 7 |
# File 'lib/opensaz/general_info.rb', line 5 def initialize(content) @page = Nokogiri::HTML(content) end |
Instance Method Details
#to_a ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/opensaz/general_info.rb', line 9 def to_a keys = [:id, :c, :s, :m, :comment] ary = [] @page.css('tbody tr').each do |x| values = get_tbody_tr(x) tmp = (0...keys.size).map{ |i| [keys[i], values[i]] }.to_h ary.push(tmp) end ary end |