Class: Plaid::SearchResultInstitution

Inherits:
Object
  • Object
show all
Defined in:
lib/plaid/institution.rb

Overview

Public: A class encapsulating information about a Financial Institution supported by Plaid.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ SearchResultInstitution

Internal: Initialize the SearchResultInstitution instance.



226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/plaid/institution.rb', line 226

def initialize(hash)
  %w(id type name video logo).each do |f|
    instance_variable_set "@#{f}", hash[f]
  end

  @products = Plaid.symbolize_hash(hash['products'])
  @forgotten_password_url = hash['forgottenPassword']
  @account_locked_url = hash['accountLocked']
  @account_setup_url = hash['accountSetup']
  @fields = hash['fields'].map { |fld| Plaid.symbolize_hash(fld) }
  @colors = Plaid.symbolize_hash(hash['colors'])
  @name_break = hash['nameBreak']
end

Instance Attribute Details

#account_locked_urlObject (readonly)

Public: The String “account locked” URL.



198
199
200
# File 'lib/plaid/institution.rb', line 198

def 
  @account_locked_url
end

#account_setup_urlObject (readonly)

Public: The String “account setup” URL.



201
202
203
# File 'lib/plaid/institution.rb', line 201

def 
  @account_setup_url
end

#colorsObject (readonly)

Public: The Hash with color information for the institution.

E.g. { primary: ‘rgba(220,20,48,1)’,

darker: 'rgba(180,11,35,1)',
gradient: ['rgba(250,20,51,1)', 'rgba(227,24,55,1)'] }.


217
218
219
# File 'lib/plaid/institution.rb', line 217

def colors
  @colors
end

#fieldsObject (readonly)

Public: The Array of Hashes with login fields information.

E.g. [{ name: ‘username’, label: ‘Online ID’, type: ‘text’ },

{ name: 'password', label: 'Password', type: 'password' }].


210
211
212
# File 'lib/plaid/institution.rb', line 210

def fields
  @fields
end

#forgotten_password_urlObject (readonly)

Public: The String “forgotten password” URL.



195
196
197
# File 'lib/plaid/institution.rb', line 195

def forgotten_password_url
  @forgotten_password_url
end

#idObject (readonly)

Public: The String ID of the institution. Same as type. E.g. “bofa”.



181
182
183
# File 'lib/plaid/institution.rb', line 181

def id
  @id
end

#logoObject (readonly)

Public: The String with base64 encoded logo.



220
221
222
# File 'lib/plaid/institution.rb', line 220

def 
  @logo
end

#nameObject (readonly)

Public: The String institution name. E.g. “Bank of America”.



187
188
189
# File 'lib/plaid/institution.rb', line 187

def name
  @name
end

#name_breakObject (readonly)

Public: ???.



223
224
225
# File 'lib/plaid/institution.rb', line 223

def name_break
  @name_break
end

#productsObject (readonly)

Public: The Hash with supported products as keys and booleans as values.

E.g. { auth: true, balance: true, connect: true, info: true }.



192
193
194
# File 'lib/plaid/institution.rb', line 192

def products
  @products
end

#typeObject (readonly)

Public: The String short name (“type”) of the institution. E.g. “bofa”.



184
185
186
# File 'lib/plaid/institution.rb', line 184

def type
  @type
end

#videoObject (readonly)

Public: The String video (???).



204
205
206
# File 'lib/plaid/institution.rb', line 204

def video
  @video
end

Instance Method Details

#inspectObject Also known as: to_s

Public: Get a String representation of the institution.

Returns a String.



243
244
245
246
# File 'lib/plaid/institution.rb', line 243

def inspect
  "#<Plaid::SearchResultInstitution id=#{id.inspect}, name=#{name.inspect}, " \
    '...>'
end