Class: Seiun::XMLGenerators::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/seiun/xml_generators/base.rb

Direct Known Subclasses

BatchXML, JobXML

Instance Method Summary collapse

Constructor Details

#initialize(callback: nil) ⇒ Base

Returns a new instance of Base.



4
5
6
7
8
# File 'lib/seiun/xml_generators/base.rb', line 4

def initialize(callback: nil)
  @callback = callback
  @rexml_doc = REXML::Document.new
  @rexml_doc << REXML::XMLDecl.new('1.0', 'UTF-8')
end

Instance Method Details

#to_sObject



10
11
12
13
14
15
16
17
# File 'lib/seiun/xml_generators/base.rb', line 10

def to_s
  io = StringIO.new
  rexml_doc.write(io)
  io.rewind
  str = io.read
  io = nil
  str
end