Class: Dom::NoDoc
Overview
NoDoc is used by Dom and Node to preserve the correct hierachy of the tree, while inserting nodes with non (or not yet) existing parents.
For example let’s add the node ‘foo.bar.baz’ in our empty Dom. This will result in the following tree:
-foo (NoDoc)
-bar (NoDoc)
-baz
If a documented node with the same path is inserted, the NoDoc-node will be replaced by it.
Constant Summary
Constants included from Node
Dom::Node::ABSOLUTE, Dom::Node::LEAF, Dom::Node::NODENAME, Dom::Node::NS_SEP, Dom::Node::NS_SEP_STRING, Dom::Node::RELATIVE
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ NoDoc
constructor
A new instance of NoDoc.
Methods included from Node
#[], #add_node, #children, #each_child, #find, #has_children?, #namespace, #parent, #parents, #print_tree, #qualified_name, #resolve, #siblings
Constructor Details
#initialize(name) ⇒ NoDoc
Returns a new instance of NoDoc.
21 22 23 24 |
# File 'lib/dom/no_doc.rb', line 21 def initialize(name) @name = name super() end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
19 20 21 |
# File 'lib/dom/no_doc.rb', line 19 def name @name end |