Class: AdvancedBilling::PaymentMethodBankAccountType
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::PaymentMethodBankAccountType
- Defined in:
- lib/advanced_billing/models/payment_method_bank_account_type.rb
Overview
PaymentMethodBankAccountType Model.
Instance Attribute Summary collapse
-
#masked_account_number ⇒ String
TODO: Write general description for this method.
-
#masked_routing_number ⇒ 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(masked_account_number = SKIP, masked_routing_number = SKIP, type = 'bank_account') ⇒ PaymentMethodBankAccountType
constructor
A new instance of PaymentMethodBankAccountType.
Methods inherited from BaseModel
Constructor Details
#initialize(masked_account_number = SKIP, masked_routing_number = SKIP, type = 'bank_account') ⇒ PaymentMethodBankAccountType
Returns a new instance of PaymentMethodBankAccountType.
47 48 49 50 51 52 |
# File 'lib/advanced_billing/models/payment_method_bank_account_type.rb', line 47 def initialize(masked_account_number = SKIP, masked_routing_number = SKIP, type = 'bank_account') @masked_account_number = masked_account_number unless masked_account_number == SKIP @masked_routing_number = masked_routing_number unless masked_routing_number == SKIP @type = type unless type == SKIP end |
Instance Attribute Details
#masked_account_number ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/payment_method_bank_account_type.rb', line 14 def masked_account_number @masked_account_number end |
#masked_routing_number ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/payment_method_bank_account_type.rb', line 18 def masked_routing_number @masked_routing_number end |
#type ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/models/payment_method_bank_account_type.rb', line 22 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/advanced_billing/models/payment_method_bank_account_type.rb', line 55 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. 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 type = hash['type'] ||= 'bank_account' # Create object from extracted values. PaymentMethodBankAccountType.new(masked_account_number, masked_routing_number, type) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/advanced_billing/models/payment_method_bank_account_type.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['masked_account_number'] = 'masked_account_number' @_hash['masked_routing_number'] = 'masked_routing_number' @_hash['type'] = 'type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 |
# File 'lib/advanced_billing/models/payment_method_bank_account_type.rb', line 43 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 39 40 |
# File 'lib/advanced_billing/models/payment_method_bank_account_type.rb', line 34 def self.optionals %w[ masked_account_number masked_routing_number type ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
73 74 75 76 77 78 79 |
# File 'lib/advanced_billing/models/payment_method_bank_account_type.rb', line 73 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |