Class: AdvancedBilling::ReactivationBilling
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::ReactivationBilling
- Defined in:
- lib/advanced_billing/models/reactivation_billing.rb
Overview
These values are only applicable to subscriptions using calendar billing
Instance Attribute Summary collapse
-
#reactivation_charge ⇒ ReactivationCharge
You may choose how to handle the reactivation charge for that subscription: 1) ‘prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(reactivation_charge: ReactivationCharge::PRORATED, additional_properties: {}) ⇒ ReactivationBilling
constructor
A new instance of ReactivationBilling.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(reactivation_charge: ReactivationCharge::PRORATED, additional_properties: {}) ⇒ ReactivationBilling
Returns a new instance of ReactivationBilling.
40 41 42 43 44 45 46 47 48 |
# File 'lib/advanced_billing/models/reactivation_billing.rb', line 40 def initialize(reactivation_charge: ReactivationCharge::PRORATED, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) end @reactivation_charge = reactivation_charge unless reactivation_charge == SKIP end |
Instance Attribute Details
#reactivation_charge ⇒ ReactivationCharge
You may choose how to handle the reactivation charge for that subscription: 1) ‘prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal
19 20 21 |
# File 'lib/advanced_billing/models/reactivation_billing.rb', line 19 def reactivation_charge @reactivation_charge end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/advanced_billing/models/reactivation_billing.rb', line 51 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. reactivation_charge = hash['reactivation_charge'] ||= ReactivationCharge::PRORATED # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } # Create object from extracted values. ReactivationBilling.new(reactivation_charge: reactivation_charge, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 |
# File 'lib/advanced_billing/models/reactivation_billing.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['reactivation_charge'] = 'reactivation_charge' @_hash end |
.nullables ⇒ Object
An array for nullable fields
36 37 38 |
# File 'lib/advanced_billing/models/reactivation_billing.rb', line 36 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
29 30 31 32 33 |
# File 'lib/advanced_billing/models/reactivation_billing.rb', line 29 def self.optionals %w[ reactivation_charge ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
68 69 70 71 72 73 74 |
# File 'lib/advanced_billing/models/reactivation_billing.rb', line 68 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |