Class: Plaid::UnofficialCurrencyCodeList

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/plaid/models/unofficial_currency_code_list.rb

Overview

List of unofficial currency codes

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(ada:, bat:, bch:, bnb:, btc:, btg:, cnh:, dash:, doge:, etc:, eth:, gbx:, lsk:, neo:, omg:, qtum:, usdt:, xlm:, xmr:, xrp:, zec:, zrx:, additional_properties: nil) ⇒ UnofficialCurrencyCodeList

Returns a new instance of UnofficialCurrencyCodeList.



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 138

def initialize(ada:, bat:, bch:, bnb:, btc:, btg:, cnh:, dash:, doge:, etc:,
               eth:, gbx:, lsk:, neo:, omg:, qtum:, usdt:, xlm:, xmr:, xrp:,
               zec:, zrx:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @ada = ada
  @bat = bat
  @bch = bch
  @bnb = bnb
  @btc = btc
  @btg = btg
  @cnh = cnh
  @dash = dash
  @doge = doge
  @etc = etc
  @eth = eth
  @gbx = gbx
  @lsk = lsk
  @neo = neo
  @omg = omg
  @qtum = qtum
  @usdt = usdt
  @xlm = xlm
  @xmr = xmr
  @xrp = xrp
  @zec = zec
  @zrx = zrx
  @additional_properties = additional_properties
end

Instance Attribute Details

#adaString

Cardano

Returns:

  • (String)


14
15
16
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 14

def ada
  @ada
end

#batString

Basic Attention Token

Returns:

  • (String)


18
19
20
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 18

def bat
  @bat
end

#bchString

Bitcoin Cash

Returns:

  • (String)


22
23
24
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 22

def bch
  @bch
end

#bnbString

Binance Coin

Returns:

  • (String)


26
27
28
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 26

def bnb
  @bnb
end

#btcString

Bitcoin

Returns:

  • (String)


30
31
32
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 30

def btc
  @btc
end

#btgString

Bitcoin Gold

Returns:

  • (String)


34
35
36
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 34

def btg
  @btg
end

#cnhString

Chinese Yuan (offshore)

Returns:

  • (String)


38
39
40
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 38

def cnh
  @cnh
end

#dashString

Dash

Returns:

  • (String)


42
43
44
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 42

def dash
  @dash
end

#dogeString

Dogecoin

Returns:

  • (String)


46
47
48
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 46

def doge
  @doge
end

#etcString

Ethereum Classic

Returns:

  • (String)


50
51
52
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 50

def etc
  @etc
end

#ethString

Ethereum

Returns:

  • (String)


54
55
56
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 54

def eth
  @eth
end

#gbxString

Pence sterling, i.e. British penny

Returns:

  • (String)


58
59
60
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 58

def gbx
  @gbx
end

#lskString

Lisk

Returns:

  • (String)


62
63
64
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 62

def lsk
  @lsk
end

#neoString

Neo

Returns:

  • (String)


66
67
68
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 66

def neo
  @neo
end

#omgString

OmiseGO

Returns:

  • (String)


70
71
72
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 70

def omg
  @omg
end

#qtumString

Qtum

Returns:

  • (String)


74
75
76
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 74

def qtum
  @qtum
end

#usdtString

TehterUS

Returns:

  • (String)


78
79
80
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 78

def usdt
  @usdt
end

#xlmString

Stellar Lumen

Returns:

  • (String)


82
83
84
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 82

def xlm
  @xlm
end

#xmrString

Monero

Returns:

  • (String)


86
87
88
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 86

def xmr
  @xmr
end

#xrpString

Ripple

Returns:

  • (String)


90
91
92
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 90

def xrp
  @xrp
end

#zecString

Zcash

Returns:

  • (String)


94
95
96
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 94

def zec
  @zec
end

#zrxString

0x

Returns:

  • (String)


98
99
100
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 98

def zrx
  @zrx
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 170

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  ada = hash.key?('ADA') ? hash['ADA'] : nil
  bat = hash.key?('BAT') ? hash['BAT'] : nil
  bch = hash.key?('BCH') ? hash['BCH'] : nil
  bnb = hash.key?('BNB') ? hash['BNB'] : nil
  btc = hash.key?('BTC') ? hash['BTC'] : nil
  btg = hash.key?('BTG') ? hash['BTG'] : nil
  cnh = hash.key?('CNH') ? hash['CNH'] : nil
  dash = hash.key?('DASH') ? hash['DASH'] : nil
  doge = hash.key?('DOGE') ? hash['DOGE'] : nil
  etc = hash.key?('ETC') ? hash['ETC'] : nil
  eth = hash.key?('ETH') ? hash['ETH'] : nil
  gbx = hash.key?('GBX') ? hash['GBX'] : nil
  lsk = hash.key?('LSK') ? hash['LSK'] : nil
  neo = hash.key?('NEO') ? hash['NEO'] : nil
  omg = hash.key?('OMG') ? hash['OMG'] : nil
  qtum = hash.key?('QTUM') ? hash['QTUM'] : nil
  usdt = hash.key?('USDT') ? hash['USDT'] : nil
  xlm = hash.key?('XLM') ? hash['XLM'] : nil
  xmr = hash.key?('XMR') ? hash['XMR'] : nil
  xrp = hash.key?('XRP') ? hash['XRP'] : nil
  zec = hash.key?('ZEC') ? hash['ZEC'] : nil
  zrx = hash.key?('ZRX') ? hash['ZRX'] : nil

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  UnofficialCurrencyCodeList.new(ada: ada,
                                 bat: bat,
                                 bch: bch,
                                 bnb: bnb,
                                 btc: btc,
                                 btg: btg,
                                 cnh: cnh,
                                 dash: dash,
                                 doge: doge,
                                 etc: etc,
                                 eth: eth,
                                 gbx: gbx,
                                 lsk: lsk,
                                 neo: neo,
                                 omg: omg,
                                 qtum: qtum,
                                 usdt: usdt,
                                 xlm: xlm,
                                 xmr: xmr,
                                 xrp: xrp,
                                 zec: zec,
                                 zrx: zrx,
                                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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/plaid/models/unofficial_currency_code_list.rb', line 101

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ada'] = 'ADA'
  @_hash['bat'] = 'BAT'
  @_hash['bch'] = 'BCH'
  @_hash['bnb'] = 'BNB'
  @_hash['btc'] = 'BTC'
  @_hash['btg'] = 'BTG'
  @_hash['cnh'] = 'CNH'
  @_hash['dash'] = 'DASH'
  @_hash['doge'] = 'DOGE'
  @_hash['etc'] = 'ETC'
  @_hash['eth'] = 'ETH'
  @_hash['gbx'] = 'GBX'
  @_hash['lsk'] = 'LSK'
  @_hash['neo'] = 'NEO'
  @_hash['omg'] = 'OMG'
  @_hash['qtum'] = 'QTUM'
  @_hash['usdt'] = 'USDT'
  @_hash['xlm'] = 'XLM'
  @_hash['xmr'] = 'XMR'
  @_hash['xrp'] = 'XRP'
  @_hash['zec'] = 'ZEC'
  @_hash['zrx'] = 'ZRX'
  @_hash
end

.nullablesObject

An array for nullable fields



134
135
136
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 134

def self.nullables
  []
end

.optionalsObject

An array for optional fields



129
130
131
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 129

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



241
242
243
244
245
246
247
248
249
250
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 241

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ada: #{@ada.inspect}, bat: #{@bat.inspect}, bch: #{@bch.inspect}, bnb:"\
  " #{@bnb.inspect}, btc: #{@btc.inspect}, btg: #{@btg.inspect}, cnh: #{@cnh.inspect}, dash:"\
  " #{@dash.inspect}, doge: #{@doge.inspect}, etc: #{@etc.inspect}, eth: #{@eth.inspect}, gbx:"\
  " #{@gbx.inspect}, lsk: #{@lsk.inspect}, neo: #{@neo.inspect}, omg: #{@omg.inspect}, qtum:"\
  " #{@qtum.inspect}, usdt: #{@usdt.inspect}, xlm: #{@xlm.inspect}, xmr: #{@xmr.inspect}, xrp:"\
  " #{@xrp.inspect}, zec: #{@zec.inspect}, zrx: #{@zrx.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



231
232
233
234
235
236
237
238
# File 'lib/plaid/models/unofficial_currency_code_list.rb', line 231

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ada: #{@ada}, bat: #{@bat}, bch: #{@bch}, bnb: #{@bnb}, btc: #{@btc}, btg:"\
  " #{@btg}, cnh: #{@cnh}, dash: #{@dash}, doge: #{@doge}, etc: #{@etc}, eth: #{@eth}, gbx:"\
  " #{@gbx}, lsk: #{@lsk}, neo: #{@neo}, omg: #{@omg}, qtum: #{@qtum}, usdt: #{@usdt}, xlm:"\
  " #{@xlm}, xmr: #{@xmr}, xrp: #{@xrp}, zec: #{@zec}, zrx: #{@zrx}, additional_properties:"\
  " #{@additional_properties}>"
end