Class: Plaid::SearchResultInstitution
- Inherits:
-
Object
- Object
- Plaid::SearchResultInstitution
- Defined in:
- lib/plaid/institution.rb
Overview
Public: A class encapsulating information about a Financial Institution supported by Plaid.
Instance Attribute Summary collapse
-
#account_locked_url ⇒ Object
readonly
Public: The String “account locked” URL.
-
#account_setup_url ⇒ Object
readonly
Public: The String “account setup” URL.
-
#colors ⇒ Object
readonly
Public: The Hash with color information for the institution.
-
#fields ⇒ Object
readonly
Public: The Array of Hashes with login fields information.
-
#forgotten_password_url ⇒ Object
readonly
Public: The String “forgotten password” URL.
-
#id ⇒ Object
readonly
Public: The String ID of the institution.
-
#logo ⇒ Object
readonly
Public: The String with base64 encoded logo.
-
#name ⇒ Object
readonly
Public: The String institution name.
-
#name_break ⇒ Object
readonly
Public: ???.
-
#products ⇒ Object
readonly
Public: The Hash with supported products as keys and booleans as values.
-
#type ⇒ Object
readonly
Public: The String short name (“type”) of the institution.
-
#video ⇒ Object
readonly
Public: The String video (???).
Instance Method Summary collapse
-
#initialize(hash) ⇒ SearchResultInstitution
constructor
Internal: Initialize the SearchResultInstitution instance.
-
#inspect ⇒ Object
(also: #to_s)
Public: Get a String representation of the institution.
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_url ⇒ Object (readonly)
Public: The String “account locked” URL.
198 199 200 |
# File 'lib/plaid/institution.rb', line 198 def account_locked_url @account_locked_url end |
#account_setup_url ⇒ Object (readonly)
Public: The String “account setup” URL.
201 202 203 |
# File 'lib/plaid/institution.rb', line 201 def account_setup_url @account_setup_url end |
#colors ⇒ Object (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 |
#fields ⇒ Object (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_url ⇒ Object (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 |
#id ⇒ Object (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 |
#logo ⇒ Object (readonly)
Public: The String with base64 encoded logo.
220 221 222 |
# File 'lib/plaid/institution.rb', line 220 def logo @logo end |
#name ⇒ Object (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_break ⇒ Object (readonly)
Public: ???.
223 224 225 |
# File 'lib/plaid/institution.rb', line 223 def name_break @name_break end |
#products ⇒ Object (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 |
#type ⇒ Object (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 |
#video ⇒ Object (readonly)
Public: The String video (???).
204 205 206 |
# File 'lib/plaid/institution.rb', line 204 def video @video end |
Instance Method Details
#inspect ⇒ Object 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 |