Module: Grape::Formatter::Xml

Defined in:
lib/grape/formatter/xml.rb

Class Method Summary collapse

Class Method Details

.call(object, env) ⇒ Object



5
6
7
8
# File 'lib/grape/formatter/xml.rb', line 5

def call(object, env)
  return object.to_xml if object.respond_to?(:to_xml)
  raise Grape::Exceptions::InvalidFormatter.new(object.class, 'xml')
end