Sha256: facab9aed254eace98cdf1d959ce96c7caf09e4f822c8a6e89b9569f2af936b3

Contents?: true

Size: 384 Bytes

Versions: 51

Compression:

Stored size: 384 Bytes

Contents

require 'active_support/json'
require 'json'
module ApiResource
  module Formats
    module JsonFormat
      extend self

      def extension
        "json"
      end

      def mime_type
        "application/json"
      end

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

      def decode(json)
        JSON.parse(json)
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
api_resource-0.6.3 lib/api_resource/formats/json_format.rb
api_resource-0.6.2 lib/api_resource/formats/json_format.rb
api_resource-0.6.1 lib/api_resource/formats/json_format.rb
api_resource-0.6.0 lib/api_resource/formats/json_format.rb
api_resource-0.5.1 lib/api_resource/formats/json_format.rb
api_resource-0.5.0 lib/api_resource/formats/json_format.rb
api_resource-0.4.3 lib/api_resource/formats/json_format.rb
api_resource-0.4.2 lib/api_resource/formats/json_format.rb
api_resource-0.4.0 lib/api_resource/formats/json_format.rb
api_resource-0.3.14 lib/api_resource/formats/json_format.rb
api_resource-0.3.13 lib/api_resource/formats/json_format.rb
api_resource-0.3.12 lib/api_resource/formats/json_format.rb
api_resource-0.3.11 lib/api_resource/formats/json_format.rb
api_resource-0.3.10 lib/api_resource/formats/json_format.rb
api_resource-0.3.8 lib/api_resource/formats/json_format.rb
api_resource-0.3.7 lib/api_resource/formats/json_format.rb
api_resource-0.3.6 lib/api_resource/formats/json_format.rb
api_resource-0.3.5 lib/api_resource/formats/json_format.rb
api_resource-0.3.4 lib/api_resource/formats/json_format.rb
api_resource-0.3.3 lib/api_resource/formats/json_format.rb