Module: VCDOM::MiniDOM::ModChildNode
- Included in:
- CharacterData, Element
- Defined in:
- lib/vcdom/minidom/mod_child_node.rb
Instance Method Summary collapse
- #init_mod_child_node ⇒ Object
-
#next_sibling ⇒ Object
nextSibling of type Node, readonly The node immediately following this node.
-
#parent_node ⇒ Object
parentNode of type Node, readonly The parent of this node.
-
#previous_sibling ⇒ Object
previousSibling of type Node, readonly The node immediately preceding this node.
Instance Method Details
#init_mod_child_node ⇒ Object
45 46 47 |
# File 'lib/vcdom/minidom/mod_child_node.rb', line 45 def init_mod_child_node() @parent_node = nil end |
#next_sibling ⇒ Object
nextSibling of type Node, readonly
The node immediately following this node. If there is no such node, this returns null.
36 37 38 39 40 41 42 43 |
# File 'lib/vcdom/minidom/mod_child_node.rb', line 36 def next_sibling if ! @parent_node.nil? then if idx = @parent_node.get_index_of( self ) then return @parent_node.child_nodes.item( idx + 1 ) end end return nil end |
#parent_node ⇒ Object
parentNode of type Node, readonly
The parent of this node.
All nodes, except Attr, Document, DocumentFragment, Entity, and Notation may
have a parent.
However, if a node has just been created and not yet added to the tree,
or if it has been removed from the tree, this is null.
19 20 21 |
# File 'lib/vcdom/minidom/mod_child_node.rb', line 19 def parent_node return @parent_node end |
#previous_sibling ⇒ Object
previousSibling of type Node, readonly
The node immediately preceding this node.
If there is no such node, this returns null.
26 27 28 29 30 31 32 33 |
# File 'lib/vcdom/minidom/mod_child_node.rb', line 26 def previous_sibling if ! @parent_node.nil? then if idx = @parent_node.get_index_of( self ) then return @parent_node.child_nodes.item( idx - 1 ) end end return nil end |