Class: WebMethods::HtmlParser

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

Instance Method Summary collapse

Constructor Details

#initialize(body) ⇒ HtmlParser

Returns a new instance of HtmlParser.



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

def initialize body
  @doc = Nokogiri::HTML(body)
end

Instance Method Details

#parseObject



9
10
11
# File 'lib/web_methods/html_parser.rb', line 9

def parse
  table_to_hash @doc.css('body > table')
end