Class: FineAnts::Adapters::SimpleBancorp
- Inherits:
-
Object
- Object
- FineAnts::Adapters::SimpleBancorp
- Defined in:
- lib/fine_ants/adapters/simple_bancorp.rb
Instance Method Summary collapse
- #download ⇒ Object
-
#initialize(credentials) ⇒ SimpleBancorp
constructor
A new instance of SimpleBancorp.
- #login ⇒ Object
Constructor Details
#initialize(credentials) ⇒ SimpleBancorp
6 7 8 9 |
# File 'lib/fine_ants/adapters/simple_bancorp.rb', line 6 def initialize(credentials) @user = credentials[:user] @password = credentials[:password] end |
Instance Method Details
#download ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/fine_ants/adapters/simple_bancorp.rb', line 21 def download balance = find(".sts-available").find("b").text available_balance = find("#sts-flag").text.strip user_name = find(".masthead-username").text [ { :adapter => :simple_bancorp, :user => @user, :id => "#{user_name}", :name => "#{user_name}", :amount => parse_currency(balance), :available_amount => parse_currency(available_balance), } ].tap{ logout! } end |
#login ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/fine_ants/adapters/simple_bancorp.rb', line 11 def login visit "https://www.simple.com" click_link "Log In" fill_in "username", :with => @user fill_in "passphrase", :with => @password "Sign in" verify_login! end |