Class: AdvancedBilling::PaymentMethodNestedData
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::PaymentMethodNestedData
- Defined in:
- lib/advanced_billing/models/payment_method_nested_data.rb
Overview
A nested data structure detailing the method of payment
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.
-
#email ⇒ 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_account_number ⇒ String
TODO: Write general description for this method.
-
#masked_card_number ⇒ String
TODO: Write general description for this method.
-
#masked_routing_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.
Instance Method Summary collapse
-
#initialize(type = 'apple_pay', masked_account_number = SKIP, masked_routing_number = SKIP, card_brand = SKIP, card_expiration = SKIP, last_four = SKIP, masked_card_number = SKIP, details = SKIP, kind = SKIP, memo = SKIP, email = SKIP) ⇒ PaymentMethodNestedData
constructor
A new instance of PaymentMethodNestedData.
Methods inherited from BaseModel
Constructor Details
#initialize(type = 'apple_pay', masked_account_number = SKIP, masked_routing_number = SKIP, card_brand = SKIP, card_expiration = SKIP, last_four = SKIP, masked_card_number = SKIP, details = SKIP, kind = SKIP, memo = SKIP, email = SKIP) ⇒ PaymentMethodNestedData
Returns a new instance of PaymentMethodNestedData.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/advanced_billing/models/payment_method_nested_data.rb', line 97 def initialize(type = 'apple_pay', masked_account_number = SKIP, masked_routing_number = SKIP, card_brand = SKIP, card_expiration = SKIP, last_four = SKIP, masked_card_number = SKIP, details = SKIP, kind = SKIP, memo = SKIP, email = SKIP) @type = type unless type == SKIP @masked_account_number = masked_account_number unless masked_account_number == SKIP @masked_routing_number = masked_routing_number unless masked_routing_number == 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 @details = details unless details == SKIP @kind = kind unless kind == SKIP @memo = memo unless memo == SKIP @email = email unless email == SKIP end |
Instance Attribute Details
#card_brand ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/advanced_billing/models/payment_method_nested_data.rb', line 26 def card_brand @card_brand end |
#card_expiration ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/advanced_billing/models/payment_method_nested_data.rb', line 30 def card_expiration @card_expiration end |
#details ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/advanced_billing/models/payment_method_nested_data.rb', line 42 def details @details end |
#email ⇒ String
TODO: Write general description for this method
54 55 56 |
# File 'lib/advanced_billing/models/payment_method_nested_data.rb', line 54 def email @email end |
#kind ⇒ String
TODO: Write general description for this method
46 47 48 |
# File 'lib/advanced_billing/models/payment_method_nested_data.rb', line 46 def kind @kind end |
#last_four ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/advanced_billing/models/payment_method_nested_data.rb', line 34 def last_four @last_four end |
#masked_account_number ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/payment_method_nested_data.rb', line 18 def masked_account_number @masked_account_number end |
#masked_card_number ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/advanced_billing/models/payment_method_nested_data.rb', line 38 def masked_card_number @masked_card_number end |
#masked_routing_number ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/models/payment_method_nested_data.rb', line 22 def masked_routing_number @masked_routing_number end |
#memo ⇒ String
TODO: Write general description for this method
50 51 52 |
# File 'lib/advanced_billing/models/payment_method_nested_data.rb', line 50 def memo @memo end |
#type ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/payment_method_nested_data.rb', line 14 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/advanced_billing/models/payment_method_nested_data.rb', line 116 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. type = hash['type'] ||= 'apple_pay' masked_account_number = hash.key?('masked_account_number') ? hash['masked_account_number'] : SKIP masked_routing_number = hash.key?('masked_routing_number') ? hash['masked_routing_number'] : 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 details = hash.key?('details') ? hash['details'] : SKIP kind = hash.key?('kind') ? hash['kind'] : SKIP memo = hash.key?('memo') ? hash['memo'] : SKIP email = hash.key?('email') ? hash['email'] : SKIP # Create object from extracted values. PaymentMethodNestedData.new(type, masked_account_number, masked_routing_number, card_brand, card_expiration, last_four, masked_card_number, details, kind, memo, email) end |
.names ⇒ Object
A mapping from model property names to API property names.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/advanced_billing/models/payment_method_nested_data.rb', line 57 def self.names @_hash = {} if @_hash.nil? @_hash['type'] = 'type' @_hash['masked_account_number'] = 'masked_account_number' @_hash['masked_routing_number'] = 'masked_routing_number' @_hash['card_brand'] = 'card_brand' @_hash['card_expiration'] = 'card_expiration' @_hash['last_four'] = 'last_four' @_hash['masked_card_number'] = 'masked_card_number' @_hash['details'] = 'details' @_hash['kind'] = 'kind' @_hash['memo'] = 'memo' @_hash['email'] = 'email' @_hash end |
.nullables ⇒ Object
An array for nullable fields
91 92 93 94 95 |
# File 'lib/advanced_billing/models/payment_method_nested_data.rb', line 91 def self.nullables %w[ last_four ] end |
.optionals ⇒ Object
An array for optional fields
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/advanced_billing/models/payment_method_nested_data.rb', line 74 def self.optionals %w[ type masked_account_number masked_routing_number card_brand card_expiration last_four masked_card_number details kind memo email ] end |