Sha256: 7aa4bf2cd2ea7fedf3d8bee30aba84cb434caff244a07e9c82d47d42d212d7f1

Contents?: true

Size: 439 Bytes

Versions: 13

Compression:

Stored size: 439 Bytes

Contents

# frozen_string_literal: true

require "active_support/core_ext/hash/conversions"

module ActiveResource
  module Formats
    module XmlFormat
      extend self

      def extension
        "xml"
      end

      def mime_type
        "application/xml"
      end

      def encode(hash, options = {})
        hash.to_xml(options)
      end

      def decode(xml)
        Formats.remove_root(Hash.from_xml(xml))
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
activeresource-6.1.4 lib/active_resource/formats/xml_format.rb
activeresource-6.1.3 lib/active_resource/formats/xml_format.rb
activeresource-6.1.2 lib/active_resource/formats/xml_format.rb
activeresource-6.1.1 lib/active_resource/formats/xml_format.rb
activeresource-6.1.0 lib/active_resource/formats/xml_format.rb
ric-0.14.2 vendor/bundle/ruby/2.7.0/gems/activeresource-5.1.1/lib/active_resource/formats/xml_format.rb
ric-0.14.1 vendor/bundle/ruby/2.7.0/gems/activeresource-5.1.1/lib/active_resource/formats/xml_format.rb
activeresource-6.0.0 lib/active_resource/formats/xml_format.rb
ric-0.14.0 vendor/bundle/ruby/2.7.0/gems/activeresource-5.1.1/lib/active_resource/formats/xml_format.rb
activeresource-5.1.1 lib/active_resource/formats/xml_format.rb
ric-0.13.0 vendor/bundle/ruby/2.5.0/gems/activeresource-5.1.0/lib/active_resource/formats/xml_format.rb
ric-0.12.2 vendor/bundle/ruby/2.5.0/gems/activeresource-5.1.0/lib/active_resource/formats/xml_format.rb
activeresource-5.1.0 lib/active_resource/formats/xml_format.rb