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.3.2 lib/api_resource/formats/json_format.rb
api_resource-0.3.1 lib/api_resource/formats/json_format.rb
api_resource-0.3.0 lib/api_resource/formats/json_format.rb
api_resource-0.2.11 lib/api_resource/formats/json_format.rb
api_resource-0.2.10 lib/api_resource/formats/json_format.rb
api_resource-0.2.9 lib/api_resource/formats/json_format.rb
api_resource-0.2.8 lib/api_resource/formats/json_format.rb
api_resource-0.2.7 lib/api_resource/formats/json_format.rb
api_resource-0.2.6 lib/api_resource/formats/json_format.rb
api_resource-0.2.5 lib/api_resource/formats/json_format.rb
api_resource-0.2.4 lib/api_resource/formats/json_format.rb