Class: BankScrap::Bank
- Inherits:
-
Object
- Object
- BankScrap::Bank
- Defined in:
- lib/bank_scrap/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'
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.
9 10 11 |
# File 'lib/bank_scrap/bank.rb', line 9 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.
7 8 9 |
# File 'lib/bank_scrap/bank.rb', line 7 def accounts @accounts end |
#headers ⇒ Object
Returns the value of attribute headers.
7 8 9 |
# File 'lib/bank_scrap/bank.rb', line 7 def headers @headers end |
#investments ⇒ Object
Returns the value of attribute investments.
7 8 9 |
# File 'lib/bank_scrap/bank.rb', line 7 def investments @investments end |
Instance Method Details
#account_with_iban(iban) ⇒ Object
27 28 29 30 31 |
# File 'lib/bank_scrap/bank.rb', line 27 def account_with_iban(iban) accounts.find do |account| account.iban.gsub(' ', '') == iban.gsub(' ', '') end end |
#fetch_accounts ⇒ Object
Interface method placeholders
15 16 17 |
# File 'lib/bank_scrap/bank.rb', line 15 def fetch_accounts fail "#{self.class} should implement a fetch_account method" end |
#fetch_investments ⇒ Object
19 20 21 |
# File 'lib/bank_scrap/bank.rb', line 19 def fetch_investments fail "#{self.class} should implement a fetch_investment method" end |
#fetch_transactions_for ⇒ Object
23 24 25 |
# File 'lib/bank_scrap/bank.rb', line 23 def fetch_transactions_for(*) fail "#{self.class} should implement a fetch_transactions method" end |