Class: AdvancedBilling::SubscriptionAddCouponErrorException
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- AdvancedBilling::SubscriptionAddCouponErrorException
- Defined in:
- lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb
Overview
Subscription Add Coupon Error class.
Instance Attribute Summary collapse
-
#codes ⇒ Array[String]
TODO: Write general description for this method.
-
#coupon_code ⇒ Array[String]
TODO: Write general description for this method.
-
#coupon_codes ⇒ Array[String]
TODO: Write general description for this method.
-
#subscription ⇒ Array[String]
TODO: Write general description for this method.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ SubscriptionAddCouponErrorException
constructor
The constructor.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ SubscriptionAddCouponErrorException
The constructor.
31 32 33 34 35 |
# File 'lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb', line 31 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#codes ⇒ Array[String]
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb', line 14 def codes @codes end |
#coupon_code ⇒ Array[String]
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb', line 18 def coupon_code @coupon_code end |
#coupon_codes ⇒ Array[String]
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb', line 22 def coupon_codes @coupon_codes end |
#subscription ⇒ Array[String]
TODO: Write general description for this method
26 27 28 |
# File 'lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb', line 26 def subscription @subscription end |
Instance Method Details
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
40 41 42 43 44 45 |
# File 'lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb', line 40 def unbox(hash) @codes = hash.key?('codes') ? hash['codes'] : SKIP @coupon_code = hash.key?('coupon_code') ? hash['coupon_code'] : SKIP @coupon_codes = hash.key?('coupon_codes') ? hash['coupon_codes'] : SKIP @subscription = hash.key?('subscription') ? hash['subscription'] : SKIP end |