Class: Grape::Formatter::Xml

Inherits:
Base
  • Object
show all
Defined in:
lib/grape/formatter/xml.rb

Class Method Summary collapse

Methods inherited from Base

inherited

Class Method Details

.call(object, _env) ⇒ Object



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

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

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