Class: WiseML::WiseML

Inherits:
Object
  • Object
show all
Includes:
ROXML
Defined in:
lib/wiseml/wiseml.rb

Constant Summary collapse

NAMESPACE =
"http://wisebed.eu/ns/wiseml/1.0"

Instance Method Summary collapse

Instance Method Details

#to_sObject



28
29
30
# File 'lib/wiseml/wiseml.rb', line 28

def to_s
  to_xmldoc.root.to_s
end

#to_xmldocObject



17
18
19
20
21
22
# File 'lib/wiseml/wiseml.rb', line 17

def to_xmldoc
  doc = Nokogiri::XML::Document.new
  doc.root = self.to_xml
  doc.root.add_namespace_definition(nil, NAMESPACE)
  doc
end

#write_to(string_or_io) ⇒ Object



24
25
26
# File 'lib/wiseml/wiseml.rb', line 24

def write_to(string_or_io)
  to_xmldoc.write_to(string_or_io, :encoding => 'UTF-8')
end