Class: AdvancedBilling::EventBasedBillingSegmentErrorsException
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- AdvancedBilling::EventBasedBillingSegmentErrorsException
- Defined in:
- lib/advanced_billing/exceptions/event_based_billing_segment_errors_exception.rb
Overview
Event Based Billing Segment Errors class.
Instance Attribute Summary collapse
-
#errors ⇒ Hash[String, Object]
The key of the object would be a number (an index in the request array) where the error occurred.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ EventBasedBillingSegmentErrorsException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ EventBasedBillingSegmentErrorsException
The constructor.
22 23 24 25 26 |
# File 'lib/advanced_billing/exceptions/event_based_billing_segment_errors_exception.rb', line 22 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#errors ⇒ Hash[String, Object]
The key of the object would be a number (an index in the request array) where the error occurred. In the value object, the key represents the field and the value is an array with error messages. In most cases, this object would contain just one key.
17 18 19 |
# File 'lib/advanced_billing/exceptions/event_based_billing_segment_errors_exception.rb', line 17 def errors @errors end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
31 32 33 |
# File 'lib/advanced_billing/exceptions/event_based_billing_segment_errors_exception.rb', line 31 def unbox(hash) @errors = hash.key?('errors') ? hash['errors'] : SKIP end |