Class: Easyship::Handlers::ResponseBodyHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/easyship/handlers/response_body_handler.rb

Overview

Handles the response body

Class Method Summary collapse

Class Method Details

.handle_response(response) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/easyship/handlers/response_body_handler.rb', line 7

def self.handle_response(response)
  body = response.body

  JSON.parse(body, symbolize_names: true)
rescue JSON::ParserError
  nil
end