Class/Module Index [+]

Quicksearch

HTML5::TreeBuilders::Hpricot::Element

Public Class Methods

hpricot_class() click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 66
def self.hpricot_class
  ::Hpricot::Elem
end
new(name) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 70
def initialize(name)
  super(name)

  @hpricot = ::Hpricot::Elem.new(::Hpricot::STag.new(name))
end

Public Instance Methods

attributes() click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 112
def attributes
  AttributeProxy.new(@hpricot)
end
attributes=(attrs) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 116
def attributes=(attrs)
  attrs.each { |name, value| @hpricot[name] = value }
end
cloneNode() click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 80
def cloneNode
  attributes.inject(self.class.new(name)) do |node, (name, value)|
    node.hpricot[name] = value
    node
  end
end
name() click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 76
def name
  @hpricot.stag.name
end
printTree(indent=0) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/hpricot.rb, line 120
def printTree(indent=0)
  tree = "\n|#{' ' * indent}<#{name}>"
  indent += 2
  attributes.each do |name, value|
    next if name == 'xmlns'
    tree += "\n|#{' ' * indent}#{name}=\"#{value}\""
  end
  childNodes.inject(tree) { |tree, child| tree + child.printTree(indent) }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.