Module: SimpleSerializer
Instance Method Summary collapse
Instance Method Details
#to_xml(options = {}) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/xml_serialization.rb', line 8 def to_xml(={}) builder = [:builder] || Builder::XmlMarkup.new(:indent => [:indent]) tag = [:root] || self.class.name.downcase dasherize = ! .has_key?(:dasherize) || [:dasherize] tag = dasherize ? tag.to_s.dasherize : tag builder.tag!(tag, self.to_s) end |