Class: FineAnts::Adapters::UfbDirect
- Inherits:
-
Object
- Object
- FineAnts::Adapters::UfbDirect
- Defined in:
- lib/fine_ants/adapters/ufb_direct.rb
Instance Method Summary collapse
- #download ⇒ Object
-
#initialize(credentials) ⇒ UfbDirect
constructor
A new instance of UfbDirect.
- #login ⇒ Object
- #two_factor_response(answer) ⇒ Object
Constructor Details
#initialize(credentials) ⇒ UfbDirect
Returns a new instance of UfbDirect.
6 7 8 9 |
# File 'lib/fine_ants/adapters/ufb_direct.rb', line 6 def initialize(credentials) @user = credentials[:user] @password = credentials[:password] end |
Instance Method Details
#download ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/fine_ants/adapters/ufb_direct.rb', line 36 def download sleep 5 rows = all(".details-container") rows.map { |row| { adapter: :ufb_direct, user: @user, id: row.find(".details-container__account-name").text, name: row.find(".details-container__account-name").text, amount: BigDecimal( row.find(".details-container__account-amount").text.match(/\$(.*)$/)[1].delete(",") ) } } end |
#login ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/fine_ants/adapters/ufb_direct.rb', line 11 def login visit "https://onlinebanking.ufbdirect.com/auth/login" sleep 2 click_link "Login" sleep 2 fill_in "Username", with: @user fill_in "Password", with: @password sleep 1 "Login" begin find ".multi-factor" "btn-sms" false rescue Capybara::ElementNotFound verify_login! true end end |
#two_factor_response(answer) ⇒ Object
30 31 32 33 34 |
# File 'lib/fine_ants/adapters/ufb_direct.rb', line 30 def two_factor_response(answer) fill_in "access-code-entry", with: answer "Continue" verify_login! end |