Class: Bankscrap::Bank
- Inherits:
-
Object
- Object
- Bankscrap::Bank
- 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
-
#accounts ⇒ Object
Returns the value of attribute accounts.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#investments ⇒ Object
Returns the value of attribute investments.
Instance Method Summary collapse
- #account_with_iban(iban) ⇒ Object
-
#fetch_accounts ⇒ Object
Interface method placeholders.
- #fetch_investments ⇒ Object
- #fetch_transactions_for ⇒ Object
-
#initialize(_user, _password, log: false, debug: false, extra_args: nil) ⇒ Bank
constructor
A new instance of Bank.
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
#accounts ⇒ Object
Returns the value of attribute accounts.
8 9 10 |
# File 'lib/bankscrap/bank.rb', line 8 def accounts @accounts end |
#headers ⇒ Object
Returns the value of attribute headers.
8 9 10 |
# File 'lib/bankscrap/bank.rb', line 8 def headers @headers end |
#investments ⇒ Object
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 account_with_iban(iban) accounts.find do |account| account.iban.delete(' ') == iban.delete(' ') end end |
#fetch_accounts ⇒ Object
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_investments ⇒ Object
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_for ⇒ Object
24 25 26 |
# File 'lib/bankscrap/bank.rb', line 24 def fetch_transactions_for(*) raise "#{self.class} should implement a fetch_transactions method" end |