Class: ProxyFetcher::Document::OgaAdapter::Node

Inherits:
Node
  • Object
show all
Defined in:
lib/proxy_fetcher/document/adapters/oga_adapter.rb

Overview

Oga DOM node

Instance Attribute Summary

Attributes inherited from Node

#node

Instance Method Summary collapse

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.

Returns:

  • (String)

    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

#contentString

Returns HTML node inner text value clean from whitespaces, tabs, etc.

Returns:

  • (String)

    node inner text



39
40
41
# File 'lib/proxy_fetcher/document/adapters/oga_adapter.rb', line 39

def content
  clear(node.text)
end

#htmlString

Returns node inner HTML.

Returns:

  • (String)

    inner HTML



47
48
49
# File 'lib/proxy_fetcher/document/adapters/oga_adapter.rb', line 47

def html
  node.to_xml
end