Class: Bankscrap::Bank

Inherits:
Object
  • Object
show all
Defined in:
lib/bankscrap/bank.rb

Constant Summary collapse

WEB_USER_AGENT =
'Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 4 Build/JOP40D) AppleWebKit/535.19 (KHTML, ' \
'like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_user, _password, log: false, debug: false, extra_args: nil) ⇒ Bank

Returns a new instance of Bank.



10
11
12
# File 'lib/bankscrap/bank.rb', line 10

def initialize(_user, _password, log: false, debug: false, extra_args: nil)
  @accounts = fetch_accounts
end

Instance Attribute Details

#accountsObject

Returns the value of attribute accounts.



8
9
10
# File 'lib/bankscrap/bank.rb', line 8

def accounts
  @accounts
end

#headersObject

Returns the value of attribute headers.



8
9
10
# File 'lib/bankscrap/bank.rb', line 8

def headers
  @headers
end

#investmentsObject

Returns the value of attribute investments.



8
9
10
# File 'lib/bankscrap/bank.rb', line 8

def investments
  @investments
end

Instance Method Details

#account_with_iban(iban) ⇒ Object



28
29
30
31
32
# File 'lib/bankscrap/bank.rb', line 28

def (iban)
  accounts.find do ||
    .iban.delete(' ') == iban.delete(' ')
  end
end

#fetch_accountsObject

Interface method placeholders



16
17
18
# File 'lib/bankscrap/bank.rb', line 16

def fetch_accounts
  raise "#{self.class} should implement a fetch_account method"
end

#fetch_investmentsObject



20
21
22
# File 'lib/bankscrap/bank.rb', line 20

def fetch_investments
  raise "#{self.class} should implement a fetch_investment method"
end

#fetch_transactions_forObject



24
25
26
# File 'lib/bankscrap/bank.rb', line 24

def fetch_transactions_for(*)
  raise "#{self.class} should implement a fetch_transactions method"
end