Class: Banker::CapitalOneUK

Inherits:
Base
  • Object
show all
Defined in:
lib/banker/capital_one_uk.rb

Overview

This class allows the data retrieval of account balaces for Capital One UK

Examples

Make a new connection

bank = Banker::CapitalOneUK.new(:username => "Joe", :password => "password")

bank.accounts.first.balance.amount #=> 4100.10

Constant Summary collapse

LOGIN_ENDPOINT =
"https://www.capitaloneonline.co.uk/CapitalOne_Consumer/Login.do"
FIELD =
{
  username: 'username',
  password: [
    'password.randomCharacter0',
    'password.randomCharacter1',
    'password.randomCharacter2'
  ]
}

Instance Attribute Summary collapse

Attributes inherited from Base

#agent, #keys

Instance Method Summary collapse

Methods inherited from Base

#class_name, #cleaner, #get, #get_letter, #memorable_required, #params, #parse_ofx

Constructor Details

#initialize(args = {}) ⇒ CapitalOneUK

Returns a new instance of CapitalOneUK.



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/banker/capital_one_uk.rb', line 28

def initialize(args = {})
  @keys = ['username', 'password']
  params(args)
  @username = args[:username]
  @password = args[:password]

  @accounts = []

  authenticate!
  get_data
end

Instance Attribute Details

#accountsObject

Returns the value of attribute accounts.



15
16
17
# File 'lib/banker/capital_one_uk.rb', line 15

def accounts
  @accounts
end

#pageObject (readonly)

Returns the value of attribute page.



16
17
18
# File 'lib/banker/capital_one_uk.rb', line 16

def page
  @page
end

#passwordObject

Returns the value of attribute password.



15
16
17
# File 'lib/banker/capital_one_uk.rb', line 15

def password
  @password
end

#usernameObject

Returns the value of attribute username.



15
16
17
# File 'lib/banker/capital_one_uk.rb', line 15

def username
  @username
end