Method: Pipl::Client::APIError.deserialize

Defined in:
lib/pipl/errors.rb

.deserialize(json_str, headers = {}) ⇒ Object



39
40
41
42
43
# File 'lib/pipl/errors.rb', line 39

def self.deserialize(json_str, headers={})
  h = JSON.parse(json_str, symbolize_names: true)
  params = Utils::extract_rate_limits(headers)
  self.new(h[:error], h[:@http_status_code], params)
end