Class: Seiun::XMLGenerators::Base
- Inherits:
-
Object
- Object
- Seiun::XMLGenerators::Base
- Defined in:
- lib/seiun/xml_generators/base.rb
Instance Method Summary collapse
-
#initialize(callback: nil) ⇒ Base
constructor
A new instance of Base.
- #to_s ⇒ Object
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_s ⇒ Object
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 |