Class: Hexp::Node::Domize
- Inherits:
-
Object
- Object
- Hexp::Node::Domize
- Defined in:
- lib/hexp/node/domize.rb
Overview
Turn nodes into DOM objects
Constant Summary
- DEFAULT_OPTIONS =
{ :include_doctype => true }.freeze
Instance Attribute Summary (collapse)
-
- (Nokogiri::HTML::Document) dom
readonly
private
The resulting DOM Document.
Instance Method Summary (collapse)
-
- (Nokogiri::HTML::Document) call
private
Turn the hexp into a DOM.
-
- (Domize) initialize(hexp, options = {})
constructor
private
Instanitiate a Domizer.
Constructor Details
- (Domize) initialize(hexp, options = {})
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Instanitiate a Domizer
22 23 24 25 26 |
# File 'lib/hexp/node/domize.rb', line 22 def initialize(hexp, = {}) @dom = Hexp::DOM @raw = hexp @options = DEFAULT_OPTIONS.merge().freeze end |
Instance Attribute Details
- (Nokogiri::HTML::Document) dom (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The resulting DOM Document
14 15 16 |
# File 'lib/hexp/node/domize.rb', line 14 def dom @dom end |
Instance Method Details
- (Nokogiri::HTML::Document) call
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Turn the hexp into a DOM
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/hexp/node/domize.rb', line 33 def call @doc = dom::Document.new @root = domize(@raw) @doc << @root if @options[:include_doctype] @doc else @root end end |