Class: XmlDataBuilder
- Inherits:
-
Object
- Object
- XmlDataBuilder
- Defined in:
- lib/xml_data_builder.rb
Defined Under Namespace
Classes: CDATA
Instance Method Summary collapse
- #document ⇒ Object
-
#initialize(data, options = {}) ⇒ XmlDataBuilder
constructor
A new instance of XmlDataBuilder.
Constructor Details
#initialize(data, options = {}) ⇒ XmlDataBuilder
Returns a new instance of XmlDataBuilder.
13 14 15 |
# File 'lib/xml_data_builder.rb', line 13 def initialize(data, = {}) @data, @options = data, end |
Instance Method Details
#document ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/xml_data_builder.rb', line 17 def document indent = @options[:indent] || 2 output = String.new xml = Builder::XmlMarkup.new(:target => output, :indent => indent) xml.instruct! to_xml(xml, @data) return output end |