Class: Verizon::EdgeDiscoveryResultException
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- Verizon::EdgeDiscoveryResultException
- Defined in:
- lib/verizon/exceptions/edge_discovery_result_exception.rb
Overview
Base type for all errors.
Instance Attribute Summary collapse
-
#data ⇒ EdgeDiscoveryResultData
For cases where user input exceeds the boundary values an additional ‘data’ key will be returned with a relevant description.
-
#message ⇒ String
Error details.
-
#status ⇒ String
HTTP status code or status of response.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ EdgeDiscoveryResultException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ EdgeDiscoveryResultException
The constructor.
28 29 30 31 32 |
# File 'lib/verizon/exceptions/edge_discovery_result_exception.rb', line 28 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#data ⇒ EdgeDiscoveryResultData
For cases where user input exceeds the boundary values an additional ‘data’ key will be returned with a relevant description.
23 24 25 |
# File 'lib/verizon/exceptions/edge_discovery_result_exception.rb', line 23 def data @data end |
#message ⇒ String
Error details.
18 19 20 |
# File 'lib/verizon/exceptions/edge_discovery_result_exception.rb', line 18 def @message end |
#status ⇒ String
HTTP status code or status of response.
14 15 16 |
# File 'lib/verizon/exceptions/edge_discovery_result_exception.rb', line 14 def status @status end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
37 38 39 40 41 |
# File 'lib/verizon/exceptions/edge_discovery_result_exception.rb', line 37 def unbox(hash) @status = hash.key?('status') ? hash['status'] : nil @message = hash.key?('message') ? hash['message'] : nil @data = EdgeDiscoveryResultData.from_hash(hash['data']) if hash['data'] end |