Class: ShellDataReportingApIs::BankAccount

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_data_reporting_ap_is/models/bank_account.rb

Overview

BankAccount Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(account_number = SKIP, bank_name = SKIP, account_name = SKIP, date_effective = SKIP, date_terminated = SKIP, iban = SKIP, currency_code = SKIP, currency_symbol = SKIP, country_iso_code = SKIP, country = SKIP, sort_code = SKIP, swift_code = SKIP, bank_type = SKIP) ⇒ BankAccount

Returns a new instance of BankAccount.



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 126

def initialize( = SKIP, bank_name = SKIP,  = SKIP,
               date_effective = SKIP, date_terminated = SKIP, iban = SKIP,
               currency_code = SKIP, currency_symbol = SKIP,
               country_iso_code = SKIP, country = SKIP, sort_code = SKIP,
               swift_code = SKIP, bank_type = SKIP)
  @account_number =  unless  == SKIP
  @bank_name = bank_name unless bank_name == SKIP
  @account_name =  unless  == SKIP
  @date_effective = date_effective unless date_effective == SKIP
  @date_terminated = date_terminated unless date_terminated == SKIP
  @iban = iban unless iban == SKIP
  @currency_code = currency_code unless currency_code == SKIP
  @currency_symbol = currency_symbol unless currency_symbol == SKIP
  @country_iso_code = country_iso_code unless country_iso_code == SKIP
  @country = country unless country == SKIP
  @sort_code = sort_code unless sort_code == SKIP
  @swift_code = swift_code unless swift_code == SKIP
  @bank_type = bank_type unless bank_type == SKIP
end

Instance Attribute Details

#account_nameString

Account Name

Returns:

  • (String)


22
23
24
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 22

def 
  @account_name
end

#account_numberString

Account Number

Returns:

  • (String)


14
15
16
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 14

def 
  @account_number
end

#bank_nameString

Bank Name

Returns:

  • (String)


18
19
20
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 18

def bank_name
  @bank_name
end

#bank_typeString

Bank Type Id and Description

Returns:

  • (String)


67
68
69
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 67

def bank_type
  @bank_type
end

#countryString

Bank Account Country Name 1-Austria 2-Belgium 3-Bulgaria 4-Croatia 5-Czech Republic

Returns:

  • (String)


55
56
57
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 55

def country
  @country
end

#country_iso_codeString

Bank Account Country ISO Code

Returns:

  • (String)


46
47
48
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 46

def country_iso_code
  @country_iso_code
end

#currency_codeString

Bank Account currency ISO code.

Returns:

  • (String)


38
39
40
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 38

def currency_code
  @currency_code
end

#currency_symbolString

Bank Account currency Symbol.

Returns:

  • (String)


42
43
44
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 42

def currency_symbol
  @currency_symbol
end

#date_effectiveString

Bank Account effective date for the payer

Returns:

  • (String)


26
27
28
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 26

def date_effective
  @date_effective
end

#date_terminatedString

Bank Account terminated date. Default is null

Returns:

  • (String)


30
31
32
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 30

def date_terminated
  @date_terminated
end

#ibanString

Bank Account IBAN for Payer

Returns:

  • (String)


34
35
36
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 34

def iban
  @iban
end

#sort_codeString

Payer bank Sort Code

Returns:

  • (String)


59
60
61
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 59

def sort_code
  @sort_code
end

#swift_codeString

Payer Bank Swift Code

Returns:

  • (String)


63
64
65
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 63

def swift_code
  @swift_code
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 147

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
  bank_name = hash.key?('BankName') ? hash['BankName'] : SKIP
   = hash.key?('AccountName') ? hash['AccountName'] : SKIP
  date_effective = hash.key?('DateEffective') ? hash['DateEffective'] : SKIP
  date_terminated =
    hash.key?('DateTerminated') ? hash['DateTerminated'] : SKIP
  iban = hash.key?('IBAN') ? hash['IBAN'] : SKIP
  currency_code = hash.key?('CurrencyCode') ? hash['CurrencyCode'] : SKIP
  currency_symbol =
    hash.key?('CurrencySymbol') ? hash['CurrencySymbol'] : SKIP
  country_iso_code =
    hash.key?('CountryISOCode') ? hash['CountryISOCode'] : SKIP
  country = hash.key?('Country') ? hash['Country'] : SKIP
  sort_code = hash.key?('SortCode') ? hash['SortCode'] : SKIP
  swift_code = hash.key?('SwiftCode') ? hash['SwiftCode'] : SKIP
  bank_type = hash.key?('BankType') ? hash['BankType'] : SKIP

  # Create object from extracted values.
  BankAccount.new(,
                  bank_name,
                  ,
                  date_effective,
                  date_terminated,
                  iban,
                  currency_code,
                  currency_symbol,
                  country_iso_code,
                  country,
                  sort_code,
                  swift_code,
                  bank_type)
end

.namesObject

A mapping from model property names to API property names.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 70

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_number'] = 'AccountNumber'
  @_hash['bank_name'] = 'BankName'
  @_hash['account_name'] = 'AccountName'
  @_hash['date_effective'] = 'DateEffective'
  @_hash['date_terminated'] = 'DateTerminated'
  @_hash['iban'] = 'IBAN'
  @_hash['currency_code'] = 'CurrencyCode'
  @_hash['currency_symbol'] = 'CurrencySymbol'
  @_hash['country_iso_code'] = 'CountryISOCode'
  @_hash['country'] = 'Country'
  @_hash['sort_code'] = 'SortCode'
  @_hash['swift_code'] = 'SwiftCode'
  @_hash['bank_type'] = 'BankType'
  @_hash
end

.nullablesObject

An array for nullable fields



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 108

def self.nullables
  %w[
    account_number
    bank_name
    account_name
    date_effective
    date_terminated
    iban
    currency_code
    currency_symbol
    country_iso_code
    country
    sort_code
    swift_code
    bank_type
  ]
end

.optionalsObject

An array for optional fields



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/shell_data_reporting_ap_is/models/bank_account.rb', line 89

def self.optionals
  %w[
    account_number
    bank_name
    account_name
    date_effective
    date_terminated
    iban
    currency_code
    currency_symbol
    country_iso_code
    country
    sort_code
    swift_code
    bank_type
  ]
end