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 124
124:     def initialize(text)
125:       super(nil, {})
126:       raise 'Text may not be nil' unless text
127:       @text = text
128:     end

Public Instance Methods

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

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.