httprot v0.2.2 HTTProt.Status

Representation for an HTTP status.

Summary

Functions

Check if the status is a failure

Create a new Status from a code

Create a new Status with the given code and text

Check if the status is a success

Convert an HTTP error text to its integer equivalent

Convert an HTTP code to its text equivalent

Types

t()
t() :: %HTTProt.Status{code: integer, text: String.t}

Functions

failure?(self)
failure?(t) :: boolean

Check if the status is a failure.

new(code)
new(integer) :: t

Create a new Status from a code.

new(code, text)
new(integer, String.t) :: t

Create a new Status with the given code and text.

success?(arg1)
success?(t) :: boolean

Check if the status is a success.

to_integer(binary)
to_integer(String.t) :: integer

Convert an HTTP error text to its integer equivalent.

to_string(int)
to_string(integer) :: String.t

Convert an HTTP code to its text equivalent.