Class: Ubiquitously::Dzone::User
Instance Attribute Summary
Attributes inherited from Base::User
#agent, #password, #username
Instance Method Summary
collapse
Methods inherited from Base::User
#initialize, #logged_in?
included
Instance Method Details
#create ⇒ Object
22
23
24
|
# File 'lib/ubiquitously/dzone.rb', line 22
def create
end
|
#login ⇒ Object
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/ubiquitously/dzone.rb', line 4
def login
return true if logged_in?
page = agent.get("http://www.dzone.com/links/loginLightbox.html")
form = page.form_with(:action => "/links/j_acegi_security_check")
form["j_username"] = username
form["j_password"] = password
page = form.submit
@logged_in = (page.body !~ /Invalid username or password/i).nil?
unless @logged_in
raise AuthenticationError.new("Invalid username or password for #{service_name.titleize}")
end
@logged_in
end
|