Class: AdvancedBilling::Prepayment1
- Defined in:
- lib/advanced_billing/models/prepayment1.rb
Overview
Prepayment1 Model.
Instance Attribute Summary collapse
-
#amount_in_cents ⇒ Float
TODO: Write general description for this method.
-
#created_at ⇒ String
The payment type of the prepayment.
-
#details ⇒ String
TODO: Write general description for this method.
-
#external ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#id ⇒ Float
TODO: Write general description for this method.
-
#memo ⇒ String
TODO: Write general description for this method.
-
#payment_type ⇒ PrepaymentMethod
The payment type of the prepayment.
-
#refunded_amount_in_cents ⇒ Float
TODO: Write general description for this method.
-
#remaining_amount_in_cents ⇒ Float
TODO: Write general description for this method.
-
#subscription_id ⇒ Float
TODO: Write general description for this method.
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.
Instance Method Summary collapse
-
#initialize(id = nil, subscription_id = nil, amount_in_cents = nil, remaining_amount_in_cents = nil, external = nil, memo = nil, created_at = nil, refunded_amount_in_cents = SKIP, details = SKIP, payment_type = SKIP) ⇒ Prepayment1
constructor
A new instance of Prepayment1.
Methods inherited from BaseModel
Constructor Details
#initialize(id = nil, subscription_id = nil, amount_in_cents = nil, remaining_amount_in_cents = nil, external = nil, memo = nil, created_at = nil, refunded_amount_in_cents = SKIP, details = SKIP, payment_type = SKIP) ⇒ Prepayment1
Returns a new instance of Prepayment1.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/advanced_billing/models/prepayment1.rb', line 82 def initialize(id = nil, subscription_id = nil, amount_in_cents = nil, remaining_amount_in_cents = nil, external = nil, memo = nil, created_at = nil, refunded_amount_in_cents = SKIP, details = SKIP, payment_type = SKIP) @id = id @subscription_id = subscription_id @amount_in_cents = amount_in_cents @remaining_amount_in_cents = remaining_amount_in_cents @refunded_amount_in_cents = refunded_amount_in_cents unless refunded_amount_in_cents == SKIP @details = details unless details == SKIP @external = external @memo = memo @payment_type = payment_type unless payment_type == SKIP @created_at = created_at end |
Instance Attribute Details
#amount_in_cents ⇒ Float
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/models/prepayment1.rb', line 22 def amount_in_cents @amount_in_cents end |
#created_at ⇒ String
The payment type of the prepayment.
50 51 52 |
# File 'lib/advanced_billing/models/prepayment1.rb', line 50 def created_at @created_at end |
#details ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/advanced_billing/models/prepayment1.rb', line 34 def details @details end |
#external ⇒ TrueClass | FalseClass
TODO: Write general description for this method
38 39 40 |
# File 'lib/advanced_billing/models/prepayment1.rb', line 38 def external @external end |
#id ⇒ Float
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/prepayment1.rb', line 14 def id @id end |
#memo ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/advanced_billing/models/prepayment1.rb', line 42 def memo @memo end |
#payment_type ⇒ PrepaymentMethod
The payment type of the prepayment.
46 47 48 |
# File 'lib/advanced_billing/models/prepayment1.rb', line 46 def payment_type @payment_type end |
#refunded_amount_in_cents ⇒ Float
TODO: Write general description for this method
30 31 32 |
# File 'lib/advanced_billing/models/prepayment1.rb', line 30 def refunded_amount_in_cents @refunded_amount_in_cents end |
#remaining_amount_in_cents ⇒ Float
TODO: Write general description for this method
26 27 28 |
# File 'lib/advanced_billing/models/prepayment1.rb', line 26 def remaining_amount_in_cents @remaining_amount_in_cents end |
#subscription_id ⇒ Float
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/prepayment1.rb', line 18 def subscription_id @subscription_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/advanced_billing/models/prepayment1.rb', line 99 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil subscription_id = hash.key?('subscription_id') ? hash['subscription_id'] : nil amount_in_cents = hash.key?('amount_in_cents') ? hash['amount_in_cents'] : nil remaining_amount_in_cents = hash.key?('remaining_amount_in_cents') ? hash['remaining_amount_in_cents'] : nil external = hash.key?('external') ? hash['external'] : nil memo = hash.key?('memo') ? hash['memo'] : nil created_at = hash.key?('created_at') ? hash['created_at'] : nil refunded_amount_in_cents = hash.key?('refunded_amount_in_cents') ? hash['refunded_amount_in_cents'] : SKIP details = hash.key?('details') ? hash['details'] : SKIP payment_type = hash.key?('payment_type') ? hash['payment_type'] : SKIP # Create object from extracted values. Prepayment1.new(id, subscription_id, amount_in_cents, remaining_amount_in_cents, external, memo, created_at, refunded_amount_in_cents, details, payment_type) end |
.names ⇒ Object
A mapping from model property names to API property names.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/advanced_billing/models/prepayment1.rb', line 53 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['subscription_id'] = 'subscription_id' @_hash['amount_in_cents'] = 'amount_in_cents' @_hash['remaining_amount_in_cents'] = 'remaining_amount_in_cents' @_hash['refunded_amount_in_cents'] = 'refunded_amount_in_cents' @_hash['details'] = 'details' @_hash['external'] = 'external' @_hash['memo'] = 'memo' @_hash['payment_type'] = 'payment_type' @_hash['created_at'] = 'created_at' @_hash end |
.nullables ⇒ Object
An array for nullable fields
78 79 80 |
# File 'lib/advanced_billing/models/prepayment1.rb', line 78 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
69 70 71 72 73 74 75 |
# File 'lib/advanced_billing/models/prepayment1.rb', line 69 def self.optionals %w[ refunded_amount_in_cents details payment_type ] end |