Sha256: cac724ecc53c14c2ba28911ce87dd50af86ad63486d5bc0050ef1f0fc16bcb96

Contents?: true

Size: 310 Bytes

Versions: 17

Compression:

Stored size: 310 Bytes

Contents

require 'faraday_middleware/response_middleware'

module FaradayMiddleware
  class ParseOj < ResponseMiddleware
    dependency 'oj'

    define_parser do |body|
      Oj.load(body, mode: :compat) unless body.strip.empty?
    end
  end
end

Faraday::Response.register_middleware(oj: FaradayMiddleware::ParseOj)

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rock_rms-8.6.0 lib/rock_rms/parse_oj.rb
rock_rms-8.5.0 lib/rock_rms/parse_oj.rb
rock_rms-8.4.0 lib/rock_rms/parse_oj.rb
rock_rms-8.3.0 lib/rock_rms/parse_oj.rb
rock_rms-8.2.1 lib/rock_rms/parse_oj.rb
rock_rms-8.2.0 lib/rock_rms/parse_oj.rb
rock_rms-8.1.0 lib/rock_rms/parse_oj.rb
rock_rms-8.0.0 lib/rock_rms/parse_oj.rb
rock_rms-7.4.0 lib/rock_rms/parse_oj.rb
rock_rms-7.3.0 lib/rock_rms/parse_oj.rb
rock_rms-7.2.0 lib/rock_rms/parse_oj.rb
rock_rms-7.1.2 lib/rock_rms/parse_oj.rb
rock_rms-7.1.1 lib/rock_rms/parse_oj.rb
rock_rms-7.1.0 lib/rock_rms/parse_oj.rb
rock_rms-7.0.3 lib/rock_rms/parse_oj.rb
rock_rms-7.0.2 lib/rock_rms/parse_oj.rb
rock_rms-7.0.1 lib/rock_rms/parse_oj.rb