Add XML renderer

This commit is contained in:
ccocchi 2012-07-15 18:23:21 +02:00
parent 213043589b
commit 9364803048
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
module RablRails
module Renderers
class XML < Base
DEFAULT_OPTIONS = { dasherize: true, skip_types: false }
def format_output(hash)
# hash = hash[options[:root_name]] if options[:root_name]
xml_options = { root: options[:root_name] }.merge!(DEFAULT_OPTIONS)
hash.to_xml(xml_options)
end
end
end
end