Class: ProxyFetcher::Document::OgaAdapter::Node
- Defined in:
- lib/proxy_fetcher/document/adapters/oga_adapter.rb
Overview
Oga DOM node
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
-
#attr(*args) ⇒ String
Returns HTML node attribute value.
-
#content ⇒ String
Returns HTML node inner text value clean from whitespaces, tabs, etc.
-
#html ⇒ String
Returns node inner HTML.
Methods inherited from Node
#at_css, #at_xpath, #content_at, #find, #initialize
Constructor Details
This class inherits a constructor from ProxyFetcher::Document::Node
Instance Method Details
#attr(*args) ⇒ String
Returns HTML node attribute value.
30 31 32 |
# File 'lib/proxy_fetcher/document/adapters/oga_adapter.rb', line 30 def attr(*args) clear(node.attribute(*args).value) end |
#content ⇒ String
Returns HTML node inner text value clean from whitespaces, tabs, etc.
39 40 41 |
# File 'lib/proxy_fetcher/document/adapters/oga_adapter.rb', line 39 def content clear(node.text) end |
#html ⇒ String
Returns node inner HTML.
47 48 49 |
# File 'lib/proxy_fetcher/document/adapters/oga_adapter.rb', line 47 def html node.to_xml end |