Class: LibDiscord::Response
- Inherits:
-
Struct
- Object
- Struct
- LibDiscord::Response
- Defined in:
- lib/lib_discord/client.rb
Overview
Instance Attribute Summary collapse
-
#body ⇒ String
readonly
Raw HTTP response body.
-
#code ⇒ String
readonly
HTTP response code.
-
#message ⇒ String
readonly
HTTP response message.
-
#parsed ⇒ Object?
readonly
Object representation of the HTTP response body parsed with
JSON.parseif the HTTP response’s content-type isapplication/json,nilotherwise. -
#success? ⇒ Boolean
readonly
trueif the HTTP response code is 2xx,falseotherwise.
Instance Attribute Details
#body ⇒ String (readonly)
3980 3981 3982 3983 3984 3985 3986 3987 |
# File 'lib/lib_discord/client.rb', line 3980 Response = Struct.new( :success?, :body, :parsed, :code, :message, keyword_init: true ) |
#code ⇒ String (readonly)
3980 3981 3982 3983 3984 3985 3986 3987 |
# File 'lib/lib_discord/client.rb', line 3980 Response = Struct.new( :success?, :body, :parsed, :code, :message, keyword_init: true ) |
#message ⇒ String (readonly)
Returns HTTP response message.
3980 3981 3982 3983 3984 3985 3986 3987 |
# File 'lib/lib_discord/client.rb', line 3980 Response = Struct.new( :success?, :body, :parsed, :code, :message, keyword_init: true ) |
#parsed ⇒ Object? (readonly)
Returns object representation of the HTTP response body parsed with JSON.parse if the HTTP response’s content-type is application/json, nil otherwise.
3980 3981 3982 3983 3984 3985 3986 3987 |
# File 'lib/lib_discord/client.rb', line 3980 Response = Struct.new( :success?, :body, :parsed, :code, :message, keyword_init: true ) |
#success? ⇒ Boolean (readonly)
3980 3981 3982 3983 3984 3985 3986 3987 |
# File 'lib/lib_discord/client.rb', line 3980 Response = Struct.new( :success?, :body, :parsed, :code, :message, keyword_init: true ) |