Class: Nominatim::Response::ParseJson

Inherits:
Faraday::Response::Middleware
  • Object
show all
Defined in:
lib/nominatim/response/parse_json.rb

Instance Method Summary collapse

Instance Method Details

#on_complete(env) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/nominatim/response/parse_json.rb', line 7

def on_complete(env)
  if env[:body].empty?
    env[:body] = nil
  else
    env[:body] = MultiJson.load(env[:body], symbolize_keys: true)
  end
end