Class: LiveJournal::Request::Login

Inherits:
Req
  • Object
show all
Defined in:
lib/livejournal/login.rb

Instance Method Summary collapse

Methods inherited from Req

#dryrun!, #dumpresponse, #verbose!

Constructor Details

#initialize(user) ⇒ Login

Returns a new instance of Login.



30
31
32
# File 'lib/livejournal/login.rb', line 30

def initialize(user)
  super(user, 'login')
end

Instance Method Details

#runObject

Fills in the fullname of the #User this was created with. (XXX this sould be updated to also get the list of communities, etc.)



35
36
37
38
39
40
41
# File 'lib/livejournal/login.rb', line 35

def run
  super
  u = @user  # should we clone here?
  u.fullname = @result['name']
  u.journals = @result.select{|k,v| k=~/^access_\d+/}.collect{|k,v| v}.sort
  u
end