Class: Text

Inherits:
SGMLObject show all
Defined in:
lib/rwd/rwd.rb,
lib/rwd/xml.rb,
lib/rwd/sgml.rb

Instance Attribute Summary

Attributes inherited from TreeObject

#children, #closed, #level, #parent, #subtype, #text, #upordown, #visible

Instance Method Summary collapse

Methods inherited from SGMLObject

#to_h, #to_s, #to_x

Methods inherited from TreeObject

#inspect, #previous

Methods included from ParseTree

#parsetree

Methods included from TextArray

#textarray

Constructor Details

#initialize(text) ⇒ Text

Returns a new instance of Text.


22
23
24
25
# File 'lib/rwd/sgml.rb', line 22

def initialize(text)
  super()
  @text = text
end

Instance Method Details

#prechildren(res, before, after, varshtml, varsstring, switches, help, oneormorefields, firstaction, tabs, tab, pda) ⇒ Object


621
622
623
624
625
626
# File 'lib/rwd/rwd.rb', line 621

def prechildren(res, before, after, varshtml, varsstring, switches, help, oneormorefields, firstaction, tabs, tab, pda)
  if not @text.scan(/[^ \t\r\n]/).empty?
    res << Format % ["Text", ""]	if $rwd_debug
    res << "#{@text}"
  end
end

#prechildren_to_s(res) ⇒ Object


27
28
29
30
# File 'lib/rwd/sgml.rb', line 27

def prechildren_to_s(res)
  #res << "#{CGI.unescapeHTML(@text)} "
  res << @text
end

#prechildren_to_sgml(res) ⇒ Object


32
33
34
35
# File 'lib/rwd/sgml.rb', line 32

def prechildren_to_sgml(res)
  #res << "#{CGI.unescapeHTML(@text)}"
  res << @text
end

#prechildren_to_x(res, closetags) ⇒ Object


14
15
16
# File 'lib/rwd/xml.rb', line 14

def prechildren_to_x(res, closetags)
  res << @text.strip	unless @text.strip.empty?
end