class PostcodeAnywhere::Response::RaiseError

Public Instance Methods

on_complete(response) click to toggle source
# File lib/postcode_anywhere/response/raise_error.rb, line 7
def on_complete(response)
  status_code = response.status.to_i
  klass = PostcodeAnywhere::Error.errors[status_code]
  return unless klass
  fail(klass.from_response(response))
end