Class: WigleApi::Scraper::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/wigle_api/scraper/parser.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(html_body) ⇒ Parser

Returns a new instance of Parser.



11
12
13
14
15
16
17
18
# File 'lib/wigle_api/scraper/parser.rb', line 11

def initialize(html_body)
  @parser = Nokogiri::HTML(html_body)

  headers = parse_headers
  results = parse_results

  @output = results.map! { |r| Hash[headers.zip(r)] }
end

Class Method Details

.new(*args) ⇒ Object



6
7
8
9
# File 'lib/wigle_api/scraper/parser.rb', line 6

def self.new(*args)
  p = super
  p.output
end

Instance Method Details

#outputObject



20
21
22
# File 'lib/wigle_api/scraper/parser.rb', line 20

def output
  @output
end