Exception: MessageMediaWebhooks::UpdateWebhook400ResponseException

Inherits:
APIException
  • Object
show all
Defined in:
lib/message_media_webhooks/exceptions/update_webhook_400_response_exception.rb

Overview

Update Webhook 400 response class.

Instance Attribute Summary collapse

Attributes inherited from APIException

#context, #response_code

Instance Method Summary collapse

Constructor Details

#initialize(reason, context) ⇒ UpdateWebhook400ResponseException

The constructor.

Parameters:

  • The (String)

    reason for raising an exception.

  • The (HttpContext)

    HttpContext of the API call.



12
13
14
15
16
# File 'lib/message_media_webhooks/exceptions/update_webhook_400_response_exception.rb', line 12

def initialize(reason, context)
  super(reason, context)
  hash = APIHelper.json_deserialize(@context.response.raw_body)
  unbox(hash)
end

Instance Attribute Details

#messageString

TODO: Write general description for this method

Returns:



7
8
9
# File 'lib/message_media_webhooks/exceptions/update_webhook_400_response_exception.rb', line 7

def message
  @message
end

Instance Method Details

#unbox(hash) ⇒ Object

Populates this object by extracting properties from a hash. response body.

Parameters:

  • The (Hash)

    deserialized response sent by the server in the



21
22
23
# File 'lib/message_media_webhooks/exceptions/update_webhook_400_response_exception.rb', line 21

def unbox(hash)
  @message = hash['message']
end