class Strife::Error

Public Class Methods

from_response(response) click to toggle source
# File lib/strife/error.rb, line 3
def self.from_response(response)
  status = response[:status].to_i

  if klass = case status
             when 400 then BadRequest
             when 401 then NotAuthorizedError
             when 500 then InternalServerError
             end
    klass.new(response)
  end
end