Class: OpenfireAdmin::HtmlParser
- Inherits:
-
Object
- Object
- OpenfireAdmin::HtmlParser
- Defined in:
- lib/openfire_admin/html_parser.rb
Overview
html parser wrapper
Instance Method Summary collapse
- #at(xpath) ⇒ Object
-
#initialize(html) ⇒ HtmlParser
constructor
A new instance of HtmlParser.
- #search(xpath, &proc) ⇒ Object
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 |