Class: FineAnts::Adapters::Purduefed

Inherits:
Object
  • Object
show all
Defined in:
lib/fine_ants/adapters/purduefed.rb

Instance Method Summary collapse

Constructor Details

#initialize(credentials) ⇒ Purduefed

Returns a new instance of Purduefed.



6
7
8
9
# File 'lib/fine_ants/adapters/purduefed.rb', line 6

def initialize(credentials)
  @user = credentials[:user]
  @password = credentials[:password]
end

Instance Method Details

#downloadObject



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/fine_ants/adapters/purduefed.rb', line 19

def download
  deposit_table = find("span", text: /Deposit Accounts/)
    .find(:xpath, "../..")
    .find(".module_container")
  loan_table = find("span", text: /Loans/)
    .find(:xpath, "../..")
    .find(".module_container")
  deposit_transactions = process_table(deposit_table)
  loan_transactions = process_table(loan_table, type: :loan)

  deposit_transactions + loan_transactions
end

#loginObject



11
12
13
14
15
16
17
# File 'lib/fine_ants/adapters/purduefed.rb', line 11

def 
  visit "https://www.purduefed.com"
  fill_in "USERNAME", with: @user
  click_button "Login"
  fill_in "M_content_PCDZ_MF3KFEF_ctl00_Password", with: @password
  click_button "Sign in"
end