Class: RablRails::Renderers::XML

Inherits:
Base
  • Object
show all
Defined in:
lib/rabl-rails/renderers/xml.rb

Constant Summary collapse

DEFAULT_OPTIONS =
{ dasherize: true, skip_types: false }

Instance Attribute Summary

Attributes inherited from Base

#_options

Instance Method Summary collapse

Methods inherited from Base

#initialize, #render

Constructor Details

This class inherits a constructor from RablRails::Renderers::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RablRails::Renderers::Base

Instance Method Details

#format_output(hash) ⇒ Object



8
9
10
11
# File 'lib/rabl-rails/renderers/xml.rb', line 8

def format_output(hash)
	xml_options = { root: _options[:root_name] }.merge!(DEFAULT_OPTIONS)
				hash.to_xml(xml_options)
end