Class: AdvancedBilling::RefundPrepaymentAggregatedErrorsResponseException

Inherits:
APIException
  • Object
show all
Defined in:
lib/advanced_billing/exceptions/refund_prepayment_aggregated_errors_response_exception.rb

Overview

Errors returned on creating a refund prepayment, grouped by field, as arrays of strings.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason, response) ⇒ RefundPrepaymentAggregatedErrorsResponseException

The constructor.

Parameters:

  • The (String)

    reason for raising an exception.

  • The (HttpResponse)

    HttpReponse of the API call.



20
21
22
23
24
# File 'lib/advanced_billing/exceptions/refund_prepayment_aggregated_errors_response_exception.rb', line 20

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

Instance Attribute Details

#errorsRefundPrepaymentAggregatedError

TODO: Write general description for this method



15
16
17
# File 'lib/advanced_billing/exceptions/refund_prepayment_aggregated_errors_response_exception.rb', line 15

def errors
  @errors
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



29
30
31
# File 'lib/advanced_billing/exceptions/refund_prepayment_aggregated_errors_response_exception.rb', line 29

def unbox(hash)
  @errors = RefundPrepaymentAggregatedError.from_hash(hash['errors']) if hash['errors']
end