Exception: Bandwidth::MessagingException
- Inherits:
-
APIException
- Object
- StandardError
- APIException
- Bandwidth::MessagingException
- Defined in:
- lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb
Overview
MessagingException class.
Instance Attribute Summary collapse
-
#description ⇒ String
TODO: Write general description for this method.
-
#type ⇒ String
TODO: Write general description for this method.
Attributes inherited from APIException
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ MessagingException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ MessagingException
The constructor.
23 24 25 26 27 |
# File 'lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb', line 23 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#description ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb', line 18 def description @description end |
#type ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb', line 14 def type @type end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
32 33 34 35 |
# File 'lib/bandwidth/messaging_lib/messaging/exceptions/messaging_exception.rb', line 32 def unbox(hash) @type = hash.key?('type') ? hash['type'] : SKIP @description = hash.key?('description') ? hash['description'] : SKIP end |