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.
228 229 230 231 232 |
# File 'lib/taskjuggler/XMLElement.rb', line 228 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
234 235 236 237 238 239 240 |
# File 'lib/taskjuggler/XMLElement.rb', line 234 def to_s(indent) out = +'' @blob.each_utf8_char do |c| out += (c == "\n" ? "\n" + ' ' * indent : c) end out end |