Sha256: 26ff4bd85160bfffdd5eae9fc9e5d22d63a5c315f36b9bb099b8784ce0a7616e

Contents?: true

Size: 309 Bytes

Versions: 12

Compression:

Stored size: 309 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

12 entries across 12 versions & 1 rubygems

Version Path
grape-2.2.0 lib/grape/formatter/xml.rb
grape-2.1.3 lib/grape/formatter/xml.rb
grape-2.1.2 lib/grape/formatter/xml.rb
grape-2.1.1 lib/grape/formatter/xml.rb
grape-2.1.0 lib/grape/formatter/xml.rb
grape-2.0.0 lib/grape/formatter/xml.rb
grape-1.8.0 lib/grape/formatter/xml.rb
grape-1.7.1 lib/grape/formatter/xml.rb
grape-1.7.0 lib/grape/formatter/xml.rb
grape-1.6.2 lib/grape/formatter/xml.rb
grape-1.6.1 lib/grape/formatter/xml.rb
grape-1.6.0 lib/grape/formatter/xml.rb