Sha256: cb45cfcd9a12472228665fd8fd98c0fe98012cfd84cfa5f2b85e54970440d61e

Contents?: true

Size: 434 Bytes

Versions: 1

Compression:

Stored size: 434 Bytes

Contents

# frozen_string_literal: true

require 'json'

module Acfs
  module Middleware
    # A middleware to encore request data using JSON.
    #
    class JSON < Serializer
      def mime
        ::Mime[:json]
      end

      def encode(data)
        ::JSON.dump data
      end

      def decode(body)
        ::JSON.load body
      end
    end

    # @deprecated
    JsonDecoder = JSON

    # @deprecated
    JsonEncoder = JSON
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acfs-1.5.0 lib/acfs/middleware/json.rb