Class: AdvancedBilling::PaymentMethodBankAccountType

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/advanced_billing/models/payment_method_bank_account_type.rb

Overview

PaymentMethodBankAccountType Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

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( = SKIP, masked_routing_number = SKIP,
               type = 'bank_account')
  @masked_account_number =  unless  == SKIP
  @masked_routing_number = masked_routing_number unless masked_routing_number == SKIP
  @type = type unless type == SKIP
end

Instance Attribute Details

#masked_account_numberString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/advanced_billing/models/payment_method_bank_account_type.rb', line 14

def 
  @masked_account_number
end

#masked_routing_numberString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/advanced_billing/models/payment_method_bank_account_type.rb', line 18

def masked_routing_number
  @masked_routing_number
end

#typeString

TODO: Write general description for this method

Returns:

  • (String)


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.
   =
    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_routing_number,
                                   type)
end

.namesObject

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

.nullablesObject

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

.optionalsObject

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.

Parameters:



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