Class: HttpReader::HashPageParser

Inherits:
BasePageParser show all
Defined in:
lib/http_reader/hash_page_parser.rb

Constant Summary collapse

KEY_IDX =
0
SELECTOR_IDX =
1
TYPE_SEPARATOR =
';'

Class Method Summary collapse

Methods inherited from BasePageParser

browse_actions_for_html, match, use_browser

Class Method Details

.parse(response, opts = {}) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/http_reader/hash_page_parser.rb', line 11

def self.parse(response, opts = {})
  page = Nokogiri::HTML(response.body)
  hash = opts.inject({}) do |h, item|
    key, value = prepare_key_value(page, item)
    h[key]     = value
    h
  end
end