Class: RubyTapasDownloader::Login
- Inherits:
-
Object
- Object
- RubyTapasDownloader::Login
- Defined in:
- lib/ruby_tapas_downloader/login.rb
Overview
Perform Login in Ruby Tapas.
Login must be performed before any attempt to download files.
Instance Attribute Summary collapse
-
#agent ⇒ Mechanize
readonly
The Mechanize agent.
-
#email ⇒ String
readonly
The e-mail for the user.
-
#password ⇒ String
readonly
The password for the user.
Instance Method Summary collapse
-
#initialize(agent, email, password) ⇒ Login
constructor
A new instance of Login.
-
#login ⇒ Object
Perform login.
Constructor Details
#initialize(agent, email, password) ⇒ Login
Returns a new instance of Login.
14 15 16 17 18 |
# File 'lib/ruby_tapas_downloader/login.rb', line 14 def initialize(agent, email, password) @agent = agent @email = email @password = password end |
Instance Attribute Details
#agent ⇒ Mechanize (readonly)
Returns the Mechanize agent.
6 7 8 |
# File 'lib/ruby_tapas_downloader/login.rb', line 6 def agent @agent end |
#email ⇒ String (readonly)
Returns the e-mail for the user.
9 10 11 |
# File 'lib/ruby_tapas_downloader/login.rb', line 9 def email @email end |
#password ⇒ String (readonly)
Returns the password for the user.
12 13 14 |
# File 'lib/ruby_tapas_downloader/login.rb', line 12 def password @password end |
Instance Method Details
#login ⇒ Object
Perform login.
21 22 23 24 25 26 |
# File 'lib/ruby_tapas_downloader/login.rb', line 21 def login RubyTapasDownloader.logger.info 'Logging in...' request_login_page fill_login_form submit_login_form end |