Class: AdvancedBilling::InvoicePaymentMethod
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::InvoicePaymentMethod
- Defined in:
- lib/advanced_billing/models/invoice_payment_method.rb
Overview
InvoicePaymentMethod Model.
Instance Attribute Summary collapse
-
#card_brand ⇒ String
TODO: Write general description for this method.
-
#card_expiration ⇒ String
TODO: Write general description for this method.
-
#details ⇒ String
TODO: Write general description for this method.
-
#kind ⇒ String
TODO: Write general description for this method.
-
#last_four ⇒ String
TODO: Write general description for this method.
-
#masked_card_number ⇒ String
TODO: Write general description for this method.
-
#memo ⇒ String
TODO: Write general description for this method.
-
#type ⇒ String
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(details: SKIP, kind: SKIP, memo: SKIP, type: SKIP, card_brand: SKIP, card_expiration: SKIP, last_four: SKIP, masked_card_number: SKIP, additional_properties: {}) ⇒ InvoicePaymentMethod
constructor
A new instance of InvoicePaymentMethod.
Methods inherited from BaseModel
Constructor Details
#initialize(details: SKIP, kind: SKIP, memo: SKIP, type: SKIP, card_brand: SKIP, card_expiration: SKIP, last_four: SKIP, masked_card_number: SKIP, additional_properties: {}) ⇒ InvoicePaymentMethod
Returns a new instance of InvoicePaymentMethod.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/advanced_billing/models/invoice_payment_method.rb', line 79 def initialize(details: SKIP, kind: SKIP, memo: SKIP, type: SKIP, card_brand: SKIP, card_expiration: SKIP, last_four: SKIP, masked_card_number: SKIP, additional_properties: {}) @details = details unless details == SKIP @kind = kind unless kind == SKIP @memo = memo unless memo == SKIP @type = type unless type == SKIP @card_brand = card_brand unless card_brand == SKIP @card_expiration = card_expiration unless card_expiration == SKIP @last_four = last_four unless last_four == SKIP @masked_card_number = masked_card_number unless masked_card_number == SKIP # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) end end |
Instance Attribute Details
#card_brand ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/advanced_billing/models/invoice_payment_method.rb', line 30 def card_brand @card_brand end |
#card_expiration ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/advanced_billing/models/invoice_payment_method.rb', line 34 def card_expiration @card_expiration end |
#details ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/invoice_payment_method.rb', line 14 def details @details end |
#kind ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/invoice_payment_method.rb', line 18 def kind @kind end |
#last_four ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/advanced_billing/models/invoice_payment_method.rb', line 38 def last_four @last_four end |
#masked_card_number ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/advanced_billing/models/invoice_payment_method.rb', line 42 def masked_card_number @masked_card_number end |
#memo ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/models/invoice_payment_method.rb', line 22 def memo @memo end |
#type ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/advanced_billing/models/invoice_payment_method.rb', line 26 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
98 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 |
# File 'lib/advanced_billing/models/invoice_payment_method.rb', line 98 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. details = hash.key?('details') ? hash['details'] : SKIP kind = hash.key?('kind') ? hash['kind'] : SKIP memo = hash.key?('memo') ? hash['memo'] : SKIP type = hash.key?('type') ? hash['type'] : SKIP card_brand = hash.key?('card_brand') ? hash['card_brand'] : SKIP card_expiration = hash.key?('card_expiration') ? hash['card_expiration'] : SKIP last_four = hash.key?('last_four') ? hash['last_four'] : SKIP masked_card_number = hash.key?('masked_card_number') ? hash['masked_card_number'] : SKIP # Clean out expected properties from Hash. names.each_value { |k| hash.delete(k) } # Create object from extracted values. InvoicePaymentMethod.new(details: details, kind: kind, memo: memo, type: type, card_brand: card_brand, card_expiration: card_expiration, last_four: last_four, masked_card_number: masked_card_number, additional_properties: hash) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/advanced_billing/models/invoice_payment_method.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['details'] = 'details' @_hash['kind'] = 'kind' @_hash['memo'] = 'memo' @_hash['type'] = 'type' @_hash['card_brand'] = 'card_brand' @_hash['card_expiration'] = 'card_expiration' @_hash['last_four'] = 'last_four' @_hash['masked_card_number'] = 'masked_card_number' @_hash end |
.nullables ⇒ Object
An array for nullable fields
73 74 75 76 77 |
# File 'lib/advanced_billing/models/invoice_payment_method.rb', line 73 def self.nullables %w[ last_four ] end |
.optionals ⇒ Object
An array for optional fields
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/advanced_billing/models/invoice_payment_method.rb', line 59 def self.optionals %w[ details kind memo type card_brand card_expiration last_four masked_card_number ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
130 131 132 133 134 135 136 |
# File 'lib/advanced_billing/models/invoice_payment_method.rb', line 130 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |