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.25 lib/api_resource/formats/json_format.rb
api_resource-0.6.24 lib/api_resource/formats/json_format.rb
api_resource-0.6.23 lib/api_resource/formats/json_format.rb
api_resource-0.6.22 lib/api_resource/formats/json_format.rb
api_resource-0.6.21 lib/api_resource/formats/json_format.rb
api_resource-0.6.20 lib/api_resource/formats/json_format.rb
api_resource-0.6.19 lib/api_resource/formats/json_format.rb
api_resource-0.6.18 lib/api_resource/formats/json_format.rb
api_resource-0.6.17 lib/api_resource/formats/json_format.rb
api_resource-0.6.16 lib/api_resource/formats/json_format.rb
api_resource-0.6.15 lib/api_resource/formats/json_format.rb
api_resource-0.6.14 lib/api_resource/formats/json_format.rb
api_resource-0.6.11 lib/api_resource/formats/json_format.rb
api_resource-0.6.9 lib/api_resource/formats/json_format.rb
api_resource-0.6.10 lib/api_resource/formats/json_format.rb
api_resource-0.6.8 lib/api_resource/formats/json_format.rb
api_resource-0.6.7 lib/api_resource/formats/json_format.rb
api_resource-0.6.6 lib/api_resource/formats/json_format.rb
api_resource-0.6.5 lib/api_resource/formats/json_format.rb
api_resource-0.6.4 lib/api_resource/formats/json_format.rb