Class: BankApi::Clients::BaseClient

Inherits:
Object
  • Object
show all
Defined in:
lib/bank_api/clients/base_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(config = BankApi::Configuration.new) ⇒ BaseClient

Returns a new instance of BaseClient.



11
12
13
# File 'lib/bank_api/clients/base_client.rb', line 11

def initialize(config = BankApi::Configuration.new)
  @days_to_check = config.days_to_check
end

Instance Method Details

#batch_transfers(transfers_data) ⇒ Object



37
38
39
40
41
42
43
44
# File 'lib/bank_api/clients/base_client.rb', line 37

def batch_transfers(transfers_data)
  validate_credentials
  transfers_data.each do |transfer_data|
    validate_transfer_missing_data(transfer_data)
    validate_transfer_valid_data(transfer_data)
  end
  execute_batch_transfers(transfers_data)
end

#get_account_balance(options) ⇒ Object



20
21
22
23
# File 'lib/bank_api/clients/base_client.rb', line 20

def (options)
  validate_credentials
  get_balance(options)
end

#get_recent_deposits(options = {}) ⇒ Object



15
16
17
18
# File 'lib/bank_api/clients/base_client.rb', line 15

def get_recent_deposits(options = {})
  validate_credentials
  parse_deposit_entries(get_deposits(options))
end

#get_recent_withdrawalsObject



25
26
27
28
# File 'lib/bank_api/clients/base_client.rb', line 25

def get_recent_withdrawals
  validate_credentials
  parse_withdrawal_entries(get_withdrawals)
end

#transfer(transfer_data) ⇒ Object



30
31
32
33
34
35
# File 'lib/bank_api/clients/base_client.rb', line 30

def transfer(transfer_data)
  validate_credentials
  validate_transfer_missing_data(transfer_data)
  validate_transfer_valid_data(transfer_data)
  execute_transfer(transfer_data)
end