Class: Copyleaks::Utils

Inherits:
Object
  • Object
show all
Defined in:
lib/copyleaks/utils/status-code.utils.rb

Class Method Summary collapse

Class Method Details

.is_rate_limit_response(code) ⇒ Object



34
35
36
# File 'lib/copyleaks/utils/status-code.utils.rb', line 34

def self.is_rate_limit_response(code)
  code.to_i == 429
end

.is_success_status_code(code) ⇒ Object



26
27
28
# File 'lib/copyleaks/utils/status-code.utils.rb', line 26

def self.is_success_status_code(code)
  code.to_i >= 200 && code.to_i <= 299
end

.is_under_maintenance_response(code) ⇒ Object



30
31
32
# File 'lib/copyleaks/utils/status-code.utils.rb', line 30

def self.is_under_maintenance_response(code)
  code.to_i == 503
end