Sha256: 2db99339d0157ecd379a2425485fa4ad5f210133dd881805a37d838100cb138a

Contents?: true

Size: 427 Bytes

Versions: 163

Compression:

Stored size: 427 Bytes

Contents

require 'active_support/json'

module ActiveResource
  module Formats
    module JsonFormat
      extend self

      def extension
        "json"
      end

      def mime_type
        "application/json"
      end

      def encode(hash, options = nil)
        ActiveSupport::JSON.encode(hash, options)
      end

      def decode(json)
        Formats.remove_root(ActiveSupport::JSON.decode(json))
      end
    end
  end
end

Version data entries

163 entries across 137 versions & 13 rubygems

Version Path
activeresource-5.0.0 lib/active_resource/formats/json_format.rb
activeresource-five-5.0.0 lib/active_resource/formats/json_format.rb
activeresource-3.2.22.5 lib/active_resource/formats/json_format.rb
activeresource-3.2.22.4 lib/active_resource/formats/json_format.rb
activeresource-3.2.22.3 lib/active_resource/formats/json_format.rb
activeresource-4.1.0 lib/active_resource/formats/json_format.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/activeresource-4.0.0/lib/active_resource/formats/json_format.rb
activeresource-3.2.22.2 lib/active_resource/formats/json_format.rb
activeresource-3.2.22.1 lib/active_resource/formats/json_format.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activeresource-3.2.12/lib/active_resource/formats/json_format.rb
activeresource-3.2.22 lib/active_resource/formats/json_format.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/activeresource-3.2.12/lib/active_resource/formats/json_format.rb
activeresource-3.2.21 lib/active_resource/formats/json_format.rb
activeresource-3.2.20 lib/active_resource/formats/json_format.rb
activeresource-3.2.19 lib/active_resource/formats/json_format.rb
activeresource-3.2.18 lib/active_resource/formats/json_format.rb
activeresource-3.2.17 lib/active_resource/formats/json_format.rb
activeresource-3.2.16 lib/active_resource/formats/json_format.rb
activeresource-3.2.15 lib/active_resource/formats/json_format.rb
activeresource-3.2.15.rc3 lib/active_resource/formats/json_format.rb