Class: Arboretum::DocTree::Elements::DocRootElement

Inherits:
Element
  • Object
show all
Defined in:
lib/arboretum/doctree.rb

Overview

Special type of element to represent the root element of a document A DocRootElement has no output but simply acts as a wrapper for the top level elements of an imported document

Instance Attribute Summary

Attributes inherited from Element

#break_within, #children, #history, #incrementers, #library, #parent, #resetters, #sibling_next, #sibling_prev, #tree_residence

Instance Method Summary collapse

Methods inherited from Element

#ancestors, #ancestors_reverse, #append_child, #append_sibling, #content, #count, #counter, create, #descendants, #detach, #find, #find_first, #find_first_n, #following_siblings, #graft_first_onto, #graft_last_onto, #graft_onto, #has_children?, #index_in_parent, #insert_child, #inspect, #lib_add, #lib_get, #listing, #matches_rule?, #overwrite!, #preceding_siblings, #preceding_siblings_reverse, #prepend_child, #prepend_sibling, #reset, #set_children!, #set_parent!, #set_sibling_next!, #set_sibling_prev!, stitch!, #text_elements, #text_string, #to_tree, #unwrap_children, #update_tree_residence

Methods included from Loggable

#log, #log_string

Methods included from Contextualized

#swap, #wrap

Constructor Details

#initializeDocRootElement

Returns a new instance of DocRootElement.



982
983
984
# File 'lib/arboretum/doctree.rb', line 982

def initialize
  super()
end

Instance Method Details

#can_have_children?Boolean

Returns:

  • (Boolean)


986
987
988
# File 'lib/arboretum/doctree.rb', line 986

def can_have_children?
  true
end

#copyObject

DocRootElement deep copy method



991
992
993
994
995
# File 'lib/arboretum/doctree.rb', line 991

def copy
  element_copy = DocRootElement.new
  element_copy.set_children!(@children.map {|child| child.copy})
  element_copy
end

#to_sObject



997
998
999
# File 'lib/arboretum/doctree.rb', line 997

def to_s
  "<Root_Element>"
end