Module: Grape::Formatter::Xml

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

Class Method Summary collapse

Class Method Details

.call(object, _env) ⇒ Object



7
8
9
10
11
# File 'lib/grape/formatter/xml.rb', line 7

def call(object, _env)
  return object.to_xml if object.respond_to?(:to_xml)

  raise Grape::Exceptions::InvalidFormatter.new(object.class, 'xml')
end