Class: Dispatcher::Discord::Types::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/bas/dispatcher/discord/types/response.rb

Overview

Represents a response received from Discord. It encapsulates essential information about the response, providing a structured way to handle and analyze Discord server responses.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Response

Returns a new instance of Response.



13
14
15
16
17
18
# File 'lib/bas/dispatcher/discord/types/response.rb', line 13

def initialize(response)
  @http_code = response.code
  @code = response["code"]
  @message = response.message
  @response = response.response
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



11
12
13
# File 'lib/bas/dispatcher/discord/types/response.rb', line 11

def code
  @code
end

#http_codeObject (readonly)

Returns the value of attribute http_code.



11
12
13
# File 'lib/bas/dispatcher/discord/types/response.rb', line 11

def http_code
  @http_code
end

#messageObject (readonly)

Returns the value of attribute message.



11
12
13
# File 'lib/bas/dispatcher/discord/types/response.rb', line 11

def message
  @message
end

#responseObject (readonly)

Returns the value of attribute response.



11
12
13
# File 'lib/bas/dispatcher/discord/types/response.rb', line 11

def response
  @response
end