class Arboretum::DocTree::Elements::TextElement

A text element of a doctree. TextElements have no tags nor attributes and are only meant to represent document content Ex: <p>Hello World</p> is a tagged element 'p' with a single text element child with text “Hello World”

Attributes

text[W]

Public Class Methods

new(text='') click to toggle source
# File lib/arboretum/doctree.rb, line 1218
def initialize(text='')
  super()
  
  # Element text
  @text = text  # String
end

Public Instance Methods

copy() click to toggle source

TextElement deep copy method

# File lib/arboretum/doctree.rb, line 1226
def copy
  TextElement.new(@text)
end
dump_markup(type=:xml) click to toggle source
# File lib/arboretum/doctree.rb, line 1234
def dump_markup(type=:xml)
  self.text.gsub('&','&amp;').gsub('<', '&lt;').gsub('>','&gt;')
end
text() click to toggle source
# File lib/arboretum/doctree.rb, line 1230
def text
  @text
end
to_s() click to toggle source
# File lib/arboretum/doctree.rb, line 1238
def to_s
  self.text.inspect
end