class MotionHTMLPipeline::DocumentFragment

Attributes

document[R]

Public Class Methods

new(html) click to toggle source
# File lib/motion-html-pipeline/document_fragment.rb, line 16
def initialize(html)
  @document = HTMLDocument.documentWithString(html)
end
parse(html) click to toggle source
# File lib/motion-html-pipeline/document_fragment.rb, line 12
def self.parse(html)
  DocumentFragment.new(html)
end

Public Instance Methods

css(query) click to toggle source
# File lib/motion-html-pipeline/document_fragment.rb, line 20
def css(query)
  document.querySelectorAll(query)
end
to_html() click to toggle source
# File lib/motion-html-pipeline/document_fragment.rb, line 24
def to_html
  document.body.innerHTML
end
Also aliased as: to_s
to_s()
Alias for: to_html