Class: ProxyFetcher::Document::OgaAdapter
- Inherits:
-
AbstractAdapter
- Object
- AbstractAdapter
- ProxyFetcher::Document::OgaAdapter
- Defined in:
- lib/proxy_fetcher/document/adapters/oga_adapter.rb
Overview
HTML parser adapter that uses Oga as a backend.
Defined Under Namespace
Classes: Node
Instance Attribute Summary
Attributes inherited from AbstractAdapter
Class Method Summary collapse
-
.install_requirements! ⇒ Object
Requires Oga gem to the application.
-
.parse(data) ⇒ ProxyFetcher::Document::OgaAdapter
Parses raw HTML content with specific gem.
Methods inherited from AbstractAdapter
#initialize, #proxy_node, setup!, #xpath
Constructor Details
This class inherits a constructor from ProxyFetcher::Document::AbstractAdapter
Class Method Details
.install_requirements! ⇒ Object
Requires Oga gem to the application.
8 9 10 |
# File 'lib/proxy_fetcher/document/adapters/oga_adapter.rb', line 8 def self.install_requirements! require "oga" end |
.parse(data) ⇒ ProxyFetcher::Document::OgaAdapter
Parses raw HTML content with specific gem.
20 21 22 |
# File 'lib/proxy_fetcher/document/adapters/oga_adapter.rb', line 20 def self.parse(data) new(::Oga.parse_html(data)) end |