Sha256: ad8ada2504b939a3b59567f739d7a69f8f8989f79ca2c4c11134585b05f0dd9f

Contents?: true

Size: 334 Bytes

Versions: 8

Compression:

Stored size: 334 Bytes

Contents

require 'faraday'
require 'multi_json'

module Nominatim
  module Response
    class ParseJson < Faraday::Response::Middleware
      def on_complete(env)
        if env[:body].empty?
          env[:body] = nil
        else
          env[:body] = MultiJson.load(env[:body], symbolize_keys: true)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
nominatim-0.0.6 lib/nominatim/response/parse_json.rb
ruby-nominatim-1.0.0 lib/nominatim/response/parse_json.rb
parallel588_nominatim-0.0.7 lib/nominatim/response/parse_json.rb
nominatim-0.0.5 lib/nominatim/response/parse_json.rb
nominatim-0.0.4 lib/nominatim/response/parse_json.rb
nominatim-0.0.3 lib/nominatim/response/parse_json.rb
nominatim-0.0.2 lib/nominatim/response/parse_json.rb
nominatim-0.0.1 lib/nominatim/response/parse_json.rb