module RestClientWrapper::Http
Constants
- SUCCESS_STATUS_CODES
Public Class Methods
bad_request?(code)
click to toggle source
400
# File lib/rest_client_wrapper/http.rb, line 45 def self.bad_request?(code) return code == Rack::Utils::SYMBOL_TO_STATUS_CODE[:bad_request] end
not_found?(code)
click to toggle source
404
# File lib/rest_client_wrapper/http.rb, line 55 def self.not_found?(code) return code == Rack::Utils::SYMBOL_TO_STATUS_CODE[:not_found] end
ok?(code)
click to toggle source
200
# File lib/rest_client_wrapper/http.rb, line 40 def self.ok?(code) return code == Rack::Utils::SYMBOL_TO_STATUS_CODE[:ok] end
success?(code)
click to toggle source
success
# File lib/rest_client_wrapper/http.rb, line 35 def self.success?(code) return SUCCESS_STATUS_CODES[code].nil? ? false : true end
too_many_requests?(code)
click to toggle source
429
# File lib/rest_client_wrapper/http.rb, line 60 def self.too_many_requests?(code) return code == Rack::Utils::SYMBOL_TO_STATUS_CODE[:too_many_requests] end