Class: AqumulateAPI::FinancialInstitution

Inherits:
Entity
  • Object
show all
Defined in:
lib/aqumulate_api/entities/financial_institution.rb

Constant Summary collapse

SOURCE_ASSOCIATIONS =
[
    { key: 'FILoginParameters', class: LoginParameter, attr: :login_parameters },
    { key: 'FiFetchParamList', class: FetchParameter, attr: :fetch_parameters },
    { key: 'FiAccountDataList', class: AccountData, attr: :account_data },
]
ATTR_MAP =
{
    id: 'FIId',
    name: 'FIName',
    url: 'Url',
}

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Entity

from_source, #initialize

Constructor Details

This class inherits a constructor from AqumulateAPI::Entity

Instance Attribute Details

#account_dataObject

Returns the value of attribute account_data.



16
17
18
# File 'lib/aqumulate_api/entities/financial_institution.rb', line 16

def 
  @account_data
end

#fetch_parametersObject

Returns the value of attribute fetch_parameters.



16
17
18
# File 'lib/aqumulate_api/entities/financial_institution.rb', line 16

def fetch_parameters
  @fetch_parameters
end

#idObject

Returns the value of attribute id.



16
17
18
# File 'lib/aqumulate_api/entities/financial_institution.rb', line 16

def id
  @id
end

#login_parametersObject

Returns the value of attribute login_parameters.



16
17
18
# File 'lib/aqumulate_api/entities/financial_institution.rb', line 16

def 
  @login_parameters
end

#nameObject

Returns the value of attribute name.



16
17
18
# File 'lib/aqumulate_api/entities/financial_institution.rb', line 16

def name
  @name
end

#urlObject

Returns the value of attribute url.



16
17
18
# File 'lib/aqumulate_api/entities/financial_institution.rb', line 16

def url
  @url
end

Class Method Details

.find(id) ⇒ Object



30
31
32
33
# File 'lib/aqumulate_api/entities/financial_institution.rb', line 30

def self.find(id)
  response = AggAccount.advisor_get_financial_institution({ 'FIId' => id })
  from_source(response['FinancialInstitution'])
end

.search(keyword) ⇒ Object



35
36
37
38
39
40
# File 'lib/aqumulate_api/entities/financial_institution.rb', line 35

def self.search(keyword)
  response = AggAccount.advisor_search_financial_institution({ 'Keyword' => keyword })
  return [] unless response.has_key?('FinancialInstitutions')

  response['FinancialInstitutions'].map { |source| from_source(source) }
end