Sha256: c44aa10059aa55a4e9e4b4d400553d8e0da85e564f171ee65aff289a4b8fcb0c

Contents?: true

Size: 308 Bytes

Versions: 10

Compression:

Stored size: 308 Bytes

Contents

# frozen_string_literal: true

module Grape
  module Formatter
    module Xml
      class << self
        def call(object, _env)
          return object.to_xml if object.respond_to?(:to_xml)
          raise Grape::Exceptions::InvalidFormatter.new(object.class, 'xml')
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
grape-1.5.3 lib/grape/formatter/xml.rb
grape-1.5.2 lib/grape/formatter/xml.rb
grape-1.5.1 lib/grape/formatter/xml.rb
grape-1.5.0 lib/grape/formatter/xml.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.4.0/lib/grape/formatter/xml.rb
grape-1.4.0 lib/grape/formatter/xml.rb
grape-1.3.3 lib/grape/formatter/xml.rb
grape-1.3.2 lib/grape/formatter/xml.rb
grape-1.3.1 lib/grape/formatter/xml.rb
grape-1.3.0 lib/grape/formatter/xml.rb