Class: Banker::Barclays

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

Constant Summary collapse

LOGIN_URL =
"https://bank.barclays.co.uk/olb/auth/LoginLink.action"
EXPORT_URL =
"https://bank.barclays.co.uk/olb/balances/ExportDataStep1.action"
FIELD =
{
  surname: "surname",
  membership_number: "membershipNumber",
  passcode: 'passcode',
  memorable_word: [
    'firstMemorableCharacter',
    'secondMemorableCharacter'
  ]
}

Instance Attribute Summary collapse

Attributes inherited from Base

#agent, #keys

Instance Method Summary collapse

Methods inherited from Base

#class_name, #get, #get_letter, #params, #parse_ofx

Constructor Details

#initialize(args = {}) ⇒ Barclays

Returns a new instance of Barclays.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/banker/barclays.rb', line 19

def initialize(args={})
  @keys = %w(surname membership_number passcode memorable_word)

  params(args)
  @surname = args.delete(:surname)
  @membership_number = args.delete(:membership_number)
  @passcode = args.delete(:passcode)
  @memorable_word = args.delete(:memorable_word)

  @accounts = []

  authenticate!
  download!
  parse_ofx
end

Instance Attribute Details

#accountsObject

Returns the value of attribute accounts.



7
8
9
# File 'lib/banker/barclays.rb', line 7

def accounts
  @accounts
end

#ofxObject

Returns the value of attribute ofx.



7
8
9
# File 'lib/banker/barclays.rb', line 7

def ofx
  @ofx
end