class RakutenWebService::Error
Public Class Methods
for(response)
click to toggle source
# File lib/rakuten_web_service/error.rb, line 9 def self.for(response) error_class = repository[response.code.to_i] error_class.new(JSON.parse(response.body)['error_description']) end
register(status_code, error)
click to toggle source
# File lib/rakuten_web_service/error.rb, line 5 def self.register(status_code, error) repository[status_code] = error end
repository()
click to toggle source
# File lib/rakuten_web_service/error.rb, line 14 def self.repository @repository ||= {} end