Class: AdvancedBilling::CreatedPrepayment
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::CreatedPrepayment
- Defined in:
- lib/advanced_billing/models/created_prepayment.rb
Overview
CreatedPrepayment Model.
Instance Attribute Summary collapse
-
#amount_in_cents ⇒ Integer
TODO: Write general description for this method.
-
#created_at ⇒ String
TODO: Write general description for this method.
-
#ending_balance_in_cents ⇒ Integer
TODO: Write general description for this method.
-
#id ⇒ Integer
TODO: Write general description for this method.
-
#memo ⇒ String
TODO: Write general description for this method.
-
#starting_balance_in_cents ⇒ Integer
TODO: Write general description for this method.
-
#subscription_id ⇒ Integer
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 = SKIP, subscription_id = SKIP, amount_in_cents = SKIP, memo = SKIP, created_at = SKIP, starting_balance_in_cents = SKIP, ending_balance_in_cents = SKIP) ⇒ CreatedPrepayment
constructor
A new instance of CreatedPrepayment.
Methods inherited from BaseModel
Constructor Details
#initialize(id = SKIP, subscription_id = SKIP, amount_in_cents = SKIP, memo = SKIP, created_at = SKIP, starting_balance_in_cents = SKIP, ending_balance_in_cents = SKIP) ⇒ CreatedPrepayment
Returns a new instance of CreatedPrepayment.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/advanced_billing/models/created_prepayment.rb', line 71 def initialize(id = SKIP, subscription_id = SKIP, amount_in_cents = SKIP, memo = SKIP, created_at = SKIP, starting_balance_in_cents = SKIP, ending_balance_in_cents = SKIP) @id = id unless id == SKIP @subscription_id = subscription_id unless subscription_id == SKIP @amount_in_cents = amount_in_cents unless amount_in_cents == SKIP @memo = memo unless memo == SKIP @created_at = created_at unless created_at == SKIP unless starting_balance_in_cents == SKIP @starting_balance_in_cents = starting_balance_in_cents end @ending_balance_in_cents = ending_balance_in_cents unless ending_balance_in_cents == SKIP end |
Instance Attribute Details
#amount_in_cents ⇒ Integer
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/models/created_prepayment.rb', line 22 def amount_in_cents @amount_in_cents end |
#created_at ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/advanced_billing/models/created_prepayment.rb', line 30 def created_at @created_at end |
#ending_balance_in_cents ⇒ Integer
TODO: Write general description for this method
38 39 40 |
# File 'lib/advanced_billing/models/created_prepayment.rb', line 38 def ending_balance_in_cents @ending_balance_in_cents end |
#id ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/created_prepayment.rb', line 14 def id @id end |
#memo ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/advanced_billing/models/created_prepayment.rb', line 26 def memo @memo end |
#starting_balance_in_cents ⇒ Integer
TODO: Write general description for this method
34 35 36 |
# File 'lib/advanced_billing/models/created_prepayment.rb', line 34 def starting_balance_in_cents @starting_balance_in_cents end |
#subscription_id ⇒ Integer
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/created_prepayment.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.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/advanced_billing/models/created_prepayment.rb', line 88 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP subscription_id = hash.key?('subscription_id') ? hash['subscription_id'] : SKIP amount_in_cents = hash.key?('amount_in_cents') ? hash['amount_in_cents'] : SKIP memo = hash.key?('memo') ? hash['memo'] : SKIP created_at = hash.key?('created_at') ? hash['created_at'] : SKIP starting_balance_in_cents = hash.key?('starting_balance_in_cents') ? hash['starting_balance_in_cents'] : SKIP ending_balance_in_cents = hash.key?('ending_balance_in_cents') ? hash['ending_balance_in_cents'] : SKIP # Create object from extracted values. CreatedPrepayment.new(id, subscription_id, amount_in_cents, memo, created_at, starting_balance_in_cents, ending_balance_in_cents) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/advanced_billing/models/created_prepayment.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['subscription_id'] = 'subscription_id' @_hash['amount_in_cents'] = 'amount_in_cents' @_hash['memo'] = 'memo' @_hash['created_at'] = 'created_at' @_hash['starting_balance_in_cents'] = 'starting_balance_in_cents' @_hash['ending_balance_in_cents'] = 'ending_balance_in_cents' @_hash end |
.nullables ⇒ Object
An array for nullable fields
67 68 69 |
# File 'lib/advanced_billing/models/created_prepayment.rb', line 67 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/advanced_billing/models/created_prepayment.rb', line 54 def self.optionals %w[ id subscription_id amount_in_cents memo created_at starting_balance_in_cents ending_balance_in_cents ] end |