Class: Arboretum::DocTree::Elements::CounterElement
- Inherits:
-
TextElement
- Object
- Element
- TextElement
- Arboretum::DocTree::Elements::CounterElement
- Defined in:
- lib/arboretum/doctree.rb
Overview
A TextElement that holds a reference to an incrementer within the tree CounterElements have no tags nor attributes and are only meant to represent document content
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
-
#copy ⇒ Object
CounterElement deep copy method.
-
#initialize(incrementer) ⇒ CounterElement
constructor
A new instance of CounterElement.
-
#text ⇒ Object
The text representation of this element is the value of the referenced incrementere.
Methods inherited from TextElement
Methods inherited from Element
#ancestors, #ancestors_reverse, #append_child, #append_sibling, #can_have_children?, #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_s, #to_tree, #unwrap_children, #update_tree_residence
Methods included from Loggable
Methods included from Contextualized
Constructor Details
#initialize(incrementer) ⇒ CounterElement
Returns a new instance of CounterElement.
1303 1304 1305 1306 |
# File 'lib/arboretum/doctree.rb', line 1303 def initialize(incrementer) super() @incrementer = incrementer end |
Instance Method Details
#copy ⇒ Object
CounterElement deep copy method
1309 1310 1311 |
# File 'lib/arboretum/doctree.rb', line 1309 def copy CounterElement.new(@incrementer) end |
#text ⇒ Object
The text representation of this element is the value of the referenced incrementere
1314 1315 1316 |
# File 'lib/arboretum/doctree.rb', line 1314 def text @incrementer.value.to_s end |