Class: Wreq::StatusCode
- Inherits:
-
Object
- Object
- Wreq::StatusCode
- Defined in:
- lib/wreq_ruby/http.rb,
lib/wreq_ruby/http.rb
Instance Method Summary collapse
-
#as_int ⇒ Integer
Returns the status code as an integer.
-
#client_error? ⇒ Boolean
Checks if status code indicates client error (4xx).
-
#informational? ⇒ Boolean
Checks if status code is informational (1xx).
- #inspect ⇒ Object
-
#redirection? ⇒ Boolean
Checks if status code indicates redirection (3xx).
-
#server_error? ⇒ Boolean
Checks if status code indicates server error (5xx).
-
#success? ⇒ Boolean
Checks if status code indicates success (2xx).
-
#to_s ⇒ String
Returns a string representation of the status code.
Instance Method Details
#as_int ⇒ Integer
Returns the status code as an integer.
92 93 |
# File 'lib/wreq_ruby/http.rb', line 92 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.
128 129 |
# File 'lib/wreq_ruby/http.rb', line 128 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.
101 102 |
# File 'lib/wreq_ruby/http.rb', line 101 def informational? end |
#inspect ⇒ Object
150 151 152 |
# File 'lib/wreq_ruby/http.rb', line 150 def inspect "#<Wreq::StatusCode #{self}>" end |
#redirection? ⇒ Boolean
Checks if status code indicates redirection (3xx).
Redirection responses indicate that further action needs to be taken to complete the request.
119 120 |
# File 'lib/wreq_ruby/http.rb', line 119 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.
137 138 |
# File 'lib/wreq_ruby/http.rb', line 137 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.
110 111 |
# File 'lib/wreq_ruby/http.rb', line 110 def success? end |
#to_s ⇒ String
Returns a string representation of the status code.
142 143 |
# File 'lib/wreq_ruby/http.rb', line 142 def to_s end |