Class: Opensaz::GeneralInfo

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

Instance Method Summary collapse

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_aObject



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