Methods

Class Index [+]

Quicksearch

TaskJuggler::XMLText

This is a specialized XMLElement to represent a simple text.

Public Class Methods

new(text) click to toggle source
     # File lib/XMLElement.rb, line 125
125:     def initialize(text)
126:       super(nil, {})
127:       raise 'Text may not be nil' unless text
128:       @text = text
129:     end

Public Instance Methods

to_s(indent) click to toggle source
     # File lib/XMLElement.rb, line 131
131:     def to_s(indent)
132:       out = ''
133:       @text.each_utf8_char do |c|
134:         case c
135:         when '<'
136:           out << '&lt;'
137:         when '>'
138:           out << '&gt;'
139:         when '&'
140:           out << '&amp;'
141:         else
142:           out << c
143:         end
144:       end
145: 
146:       out
147:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.