Class: VkMusic::Request::Login
- Defined in:
- lib/vk_music/request/login.rb
Overview
Logging in request
Instance Attribute Summary
Attributes inherited from Base
#data, #headers, #method, #path, #response
Instance Method Summary collapse
-
#initialize ⇒ Login
constructor
Initialize new request.
-
#send_form(login, password, agent) ⇒ Object
Send login form.
- #success? ⇒ Boolean
Methods inherited from Base
Constructor Details
Instance Method Details
#send_form(login, password, agent) ⇒ Object
Send login form
19 20 21 22 23 24 25 26 |
# File 'lib/vk_music/request/login.rb', line 19 def send_form(login, password, agent) form = @parser.login_form form['email'] = login form['pass'] = password page = agent.submit(form) @success = (page.uri.to_s == 'https://m.vk.com/feed') end |
#success? ⇒ Boolean
14 15 16 |
# File 'lib/vk_music/request/login.rb', line 14 def success? !!@success end |