Class: Arboretum::DocTree::Elements::PIElement
- Defined in:
- lib/arboretum/doctree.rb
Overview
An XML Processing Instruction element in the doctree PIElements have no tags nor attributes nor contribute to document content, but are preserved in the tree Ex: <?…?> represents a processing instruction i.e. <?PITarget PIContent?>
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Attributes inherited from Element
#break_within, #children, #history, #incrementers, #library, #parent, #resetters, #sibling_next, #sibling_prev, #tree_residence
Instance Method Summary collapse
-
#copy ⇒ Object
PIElement deep copy method.
- #dump_markup(type = :xml) ⇒ Object
-
#initialize(text = '') ⇒ PIElement
constructor
A new instance of PIElement.
- #to_s ⇒ Object
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_tree, #unwrap_children, #update_tree_residence
Methods included from Loggable
Methods included from Contextualized
Constructor Details
#initialize(text = '') ⇒ PIElement
Returns a new instance of PIElement.
1278 1279 1280 1281 1282 1283 |
# File 'lib/arboretum/doctree.rb', line 1278 def initialize(text='') super() # Element text @text = text # String end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
1276 1277 1278 |
# File 'lib/arboretum/doctree.rb', line 1276 def text @text end |
Instance Method Details
#copy ⇒ Object
PIElement deep copy method
1286 1287 1288 |
# File 'lib/arboretum/doctree.rb', line 1286 def copy PIElement.new(@text) end |
#dump_markup(type = :xml) ⇒ Object
1290 1291 1292 |
# File 'lib/arboretum/doctree.rb', line 1290 def dump_markup(type=:xml) "<?#{self.text.gsub('&','&').gsub('<', '<').gsub('>','>')}?>" end |
#to_s ⇒ Object
1294 1295 1296 |
# File 'lib/arboretum/doctree.rb', line 1294 def to_s "<?#{self.text}?>" end |