class RD::Element
abstruct class of node of document tree
Attributes
parent[RW]
Public Class Methods
new()
click to toggle source
# File lib/rd/element.rb, line 10 def initialize @parent = nil end
Public Instance Methods
inspect()
click to toggle source
# File lib/rd/element.rb, line 19 def inspect c = children.collect{|i| indent2(i.inspect)}.join("\n") "<#{self.class.name}>" + (c.empty? ? "" : "\n") + c end
tree()
click to toggle source
# File lib/rd/element.rb, line 14 def tree raise RuntimeError, "#{self} doesn't have a parent." unless @parent @parent.tree end