Class: TaskJuggler::XMLBlob
- Inherits:
-
XMLElement
- Object
- XMLElement
- TaskJuggler::XMLBlob
- Defined in:
- lib/taskjuggler/XMLElement.rb
Overview
This is a specialized XMLElement to represent XML blobs. The content is not interpreted and must be valid XML in the content it is added.
Instance Method Summary collapse
-
#initialize(blob = '') ⇒ XMLBlob
constructor
A new instance of XMLBlob.
- #to_s(indent) ⇒ Object
Methods inherited from XMLElement
Constructor Details
#initialize(blob = '') ⇒ XMLBlob
Returns a new instance of XMLBlob.
216 217 218 219 220 |
# File 'lib/taskjuggler/XMLElement.rb', line 216 def initialize(blob = '') super(nil, {}) raise ArgumentError, "blob may not be nil" if blob.nil? @blob = blob end |
Instance Method Details
#to_s(indent) ⇒ Object
222 223 224 225 226 227 228 |
# File 'lib/taskjuggler/XMLElement.rb', line 222 def to_s(indent) out = '' @blob.each_utf8_char do |c| out += (c == "\n" ? "\n" + ' ' * indent : c) end out end |