Class: Dom::NoDoc

Inherits:
Object
  • Object
show all
Includes:
Node
Defined in:
lib/dom/no_doc.rb

Overview

NoDoc is used by Dom and Node to preserve the correct hierachy of the tree, while inserting nodes with non 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

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

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



19
20
21
# File 'lib/dom/no_doc.rb', line 19

def name
  @name
end