Class: HelloSign::Middleware::ParseJson

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

Instance Method Summary collapse

Instance Method Details

#on_complete(env) ⇒ Object



8
9
10
11
12
# File 'lib/hello_sign/middleware/parse_json.rb', line 8

def on_complete(env)
  body = env[:body] or return

  env[:body] = ::JSON.parse(body, symbolize_names: true) if json?(env)
end