Base::Node
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/simpletree.rb, line 26 def appendChild node if node.kind_of? TextNode and childNodes.length > 0 and childNodes.last.kind_of? TextNode childNodes.last.value += node.value else childNodes << node end node.parent = self end
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/simpletree.rb, line 41 def cloneNode newNode = self.class.new name attributes.each {|name,value| newNode.attributes[name] = value} newNode.value = value newNode end
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/simpletree.rb, line 73 def hasContent childNodes.length > 0 end
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/simpletree.rb, line 56 def insertBefore node, refNode index = childNodes.index(refNode) if node.kind_of?(TextNode) && index > 0 && childNodes[index-1].kind_of?(TextNode) childNodes[index-1].value += node.value else childNodes.insert index, node end end
# File lib/feed_tools/vendor/html5/lib/html5/treebuilders/simpletree.rb, line 48 def insertText data, before=nil if before insertBefore TextNode.new(data), before else appendChild TextNode.new(data) end end
Generated with the Darkfish Rdoc Generator 2.