Class: Wreq::StatusCode

Inherits:
Object
  • Object
show all
Defined in:
lib/wreq_ruby/http.rb

Instance Method Summary collapse

Instance Method Details

#as_intInteger

Returns the status code as an integer.

Returns:

  • (Integer)

    the numeric HTTP status code (100-599)



78
79
# File 'lib/wreq_ruby/http.rb', line 78

def as_int
end

#client_error?Boolean

Checks if status code indicates client error (4xx).

Client error responses indicate that the request contains bad syntax or cannot be fulfilled.

Returns:

  • (Boolean)

    true if status is 400-499



114
115
# File 'lib/wreq_ruby/http.rb', line 114

def client_error?
end

#informational?Boolean

Checks if status code is informational (1xx).

Informational responses indicate that the request was received and the process is continuing.

Returns:

  • (Boolean)

    true if status is 100-199



87
88
# File 'lib/wreq_ruby/http.rb', line 87

def informational?
end

#redirection?Boolean

Checks if status code indicates redirection (3xx).

Redirection responses indicate that further action needs to be taken to complete the request.

Returns:

  • (Boolean)

    true if status is 300-399



105
106
# File 'lib/wreq_ruby/http.rb', line 105

def redirection?
end

#server_error?Boolean

Checks if status code indicates server error (5xx).

Server error responses indicate that the server failed to fulfill a valid request.

Returns:

  • (Boolean)

    true if status is 500-599



123
124
# File 'lib/wreq_ruby/http.rb', line 123

def server_error?
end

#success?Boolean

Checks if status code indicates success (2xx).

Success responses indicate that the request was successfully received, understood, and accepted.

Returns:

  • (Boolean)

    true if status is 200-299



96
97
# File 'lib/wreq_ruby/http.rb', line 96

def success?
end

#to_sString

Returns a string representation of the status code.

Returns:

  • (String)

    Status code as string



128
129
# File 'lib/wreq_ruby/http.rb', line 128

def to_s
end