lib/grape/formatter/xml.rb in grape-0.2.6 vs lib/grape/formatter/xml.rb in grape-0.3.0

- old
+ new

@@ -2,10 +2,11 @@ module Formatter module Xml class << self def call(object, env) - object.respond_to?(:to_xml) ? object.to_xml : object.to_s + return object.to_xml if object.respond_to?(:to_xml) + raise Grape::Exceptions::InvalidFormatter.new(object.class, 'xml') end end end end