Class: Ubiquitously::Propeller::User
- Inherits:
-
Base::User
- Object
- Base::User
- Ubiquitously::Propeller::User
- Defined in:
- lib/ubiquitously/propeller.rb
Instance Attribute Summary
Attributes inherited from Base::User
Instance Method Summary collapse
Methods inherited from Base::User
Methods included from Resourceful
Constructor Details
This class inherits a constructor from Ubiquitously::Base::User
Instance Method Details
#login ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/ubiquitously/propeller.rb', line 4 def login puts "LOGGING IN" page = agent.get("http://www.propeller.com/signin/") form = page.forms.detect {|form| form.form_node["class"] == "ajax-form"} form["member_name"] = username form["password"] = password form["submit"] = "sign in" # require to get around the ajax page = form.submit puts "DONE" @logged_in = (page.body =~ /Invalid member name or password/i).nil? && (page.body =~ /ajax-form/).nil? unless @logged_in raise AuthenticationError.new("Invalid username or password for #{service_name.titleize}") end @logged_in end |