module NginxTail::Status

Constants

NGINX_MAGIC_STATUS

Public Class Methods

client_error_status?(status) click to toggle source

Client Error 4xx

# File lib/ntail/status.rb, line 28
def self.client_error_status?(status)
  # (status.to_s != NGINX_MAGIC_STATUS) and Net::HTTPResponse::CODE_TO_OBJ[status.to_s] <= Net::HTTPClientError
  (status.to_s != NGINX_MAGIC_STATUS) and Net::HTTPResponse::CODE_CLASS_TO_OBJ[(status.to_i / 100).to_s] == Net::HTTPClientError
end
information_status?(status) click to toggle source

Informational 1xx

# File lib/ntail/status.rb, line 10
def self.information_status?(status)
  # (status.to_s != NGINX_MAGIC_STATUS) and Net::HTTPResponse::CODE_TO_OBJ[status.to_s] <= Net::HTTPInformation
  (status.to_s != NGINX_MAGIC_STATUS) and Net::HTTPResponse::CODE_CLASS_TO_OBJ[(status.to_i / 100).to_s] == Net::HTTPInformation
end
redirect_status?(status) click to toggle source

Redirection 3xx

# File lib/ntail/status.rb, line 22
def self.redirect_status?(status)
  # (status.to_s != NGINX_MAGIC_STATUS) and Net::HTTPResponse::CODE_TO_OBJ[status.to_s] <= Net::HTTPRedirection
  (status.to_s != NGINX_MAGIC_STATUS) and Net::HTTPResponse::CODE_CLASS_TO_OBJ[(status.to_i / 100).to_s] == Net::HTTPRedirection
end
server_error_status?(status) click to toggle source

Internal Server Error 5xx

# File lib/ntail/status.rb, line 34
def self.server_error_status?(status)
  # (status.to_s != NGINX_MAGIC_STATUS) and Net::HTTPResponse::CODE_TO_OBJ[status.to_s] <= Net::HTTPServerError
  (status.to_s != NGINX_MAGIC_STATUS) and Net::HTTPResponse::CODE_CLASS_TO_OBJ[(status.to_i / 100).to_s] == Net::HTTPServerError
end
success_status?(status) click to toggle source

Successful 2xx

# File lib/ntail/status.rb, line 16
def self.success_status?(status)
  # (status.to_s != NGINX_MAGIC_STATUS) and Net::HTTPResponse::CODE_TO_OBJ[status.to_s] <= Net::HTTPSuccess
  (status.to_s != NGINX_MAGIC_STATUS) and Net::HTTPResponse::CODE_CLASS_TO_OBJ[(status.to_i / 100).to_s] == Net::HTTPSuccess
end

Public Instance Methods

client_error_status?() click to toggle source
# File lib/ntail/status.rb, line 57
def client_error_status?
  self.class.client_error_status?(self.status)
end
information_status?() click to toggle source
# File lib/ntail/status.rb, line 45
def information_status?
  self.class.information_status?(self.status)
end
redirect_status?() click to toggle source
# File lib/ntail/status.rb, line 53
def redirect_status?
  self.class.redirect_status?(self.status)
end
server_error_status?() click to toggle source
# File lib/ntail/status.rb, line 61
def server_error_status?
  self.class.server_error_status?(self.status)
end
success_status?() click to toggle source
# File lib/ntail/status.rb, line 49
def success_status?
  self.class.success_status?(self.status)
end