Class/Module Index [+]

Quicksearch

HTML5::TreeWalkers::Hpricot::TreeWalker

Public Instance Methods

first_child(node) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treewalkers/hpricot.rb, line 34
def first_child(node)
  node.children.first
end
next_sibling(node) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treewalkers/hpricot.rb, line 38
def next_sibling(node)
  node.next_node
end
node_details(node) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treewalkers/hpricot.rb, line 9
def node_details(node)
  case node
  when ::Hpricot::Elem
    if node.name.empty?
      [:DOCUMENT_FRAGMENT]
    else
      [:ELEMENT, node.name,
        node.attributes.map {|name, value| [name, value]},
        !node.empty?]
    end
  when ::Hpricot::Text
    [:TEXT, node.content]
  when ::Hpricot::Comment
    [:COMMENT, node.content]
  when ::Hpricot::Doc
    [:DOCUMENT]
  when ::Hpricot::DocType
    [:DOCTYPE, node.target, node.public_id, node.system_id]
  when ::Hpricot::XMLDecl
    [nil]
  else
    [:UNKNOWN, node.class.inspect]
  end
end
parent(node) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treewalkers/hpricot.rb, line 42
def parent(node)
  node.parent
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.