Class: OpenfireAdmin::HtmlParser

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

Overview

html parser wrapper

Instance Method Summary collapse

Constructor Details

#initialize(html) ⇒ HtmlParser

Returns a new instance of HtmlParser.



29
30
31
32
# File 'lib/openfire_admin/html_parser.rb', line 29

def initialize(html)
  @doc = REHTML.to_rexml(html)
  @doc.extend(ElementHelper)
end

Instance Method Details

#at(xpath) ⇒ Object



36
37
38
# File 'lib/openfire_admin/html_parser.rb', line 36

def at(xpath)
  @doc.at(xpath)
end

#search(xpath, &proc) ⇒ Object



33
34
35
# File 'lib/openfire_admin/html_parser.rb', line 33

def search(xpath, &proc)
  @doc.search(xpath, &proc)
end