Class: Special

Inherits:
SGMLObject show all
Defined in:
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) ⇒ Special

Returns a new instance of Special.



50
51
52
53
# File 'lib/rwd/sgml.rb', line 50

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

Instance Method Details

#prechildren_to_sgml(res) ⇒ Object



55
56
57
# File 'lib/rwd/sgml.rb', line 55

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

#prechildren_to_x(res, closetags) ⇒ Object



36
37
38
# File 'lib/rwd/xml.rb', line 36

def prechildren_to_x(res, closetags)
  res << "  "*(@level-1) + @text.compress + "\n"
end