Class: LiveJournal::User
- Inherits:
-
Object
- Object
- LiveJournal::User
- Defined in:
- lib/livejournal/basic.rb
Overview
A LiveJournal user. Given a username, password, and server, running a LiveJournal::Request::Login will fill in the other fields.
Instance Attribute Summary collapse
-
#fullname ⇒ Object
User’s self-reported name, as retrieved by LiveJournal::Request::Login.
-
#journals ⇒ Object
Journals the user has posting access to.
-
#password ⇒ Object
parameter when creating a User.
-
#server ⇒ Object
parameter when creating a User.
-
#usejournal ⇒ Object
Set usejournal to log in as user username but act as user usejournal.
-
#username ⇒ Object
parameter when creating a User.
Instance Method Summary collapse
-
#initialize(username = nil, password = nil, server = nil) ⇒ User
constructor
A new instance of User.
- #journal ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(username = nil, password = nil, server = nil) ⇒ User
Returns a new instance of User.
50 51 52 53 54 55 |
# File 'lib/livejournal/basic.rb', line 50 def initialize(username=nil, password=nil, server=nil) @username = username @password = password @usejournal = nil @server = server || LiveJournal::DEFAULT_SERVER end |
Instance Attribute Details
#fullname ⇒ Object
User’s self-reported name, as retrieved by LiveJournal::Request::Login
46 47 48 |
# File 'lib/livejournal/basic.rb', line 46 def fullname @fullname end |
#journals ⇒ Object
Journals the user has posting access to
48 49 50 |
# File 'lib/livejournal/basic.rb', line 48 def journals @journals end |
#password ⇒ Object
parameter when creating a User
41 42 43 |
# File 'lib/livejournal/basic.rb', line 41 def password @password end |
#server ⇒ Object
parameter when creating a User
41 42 43 |
# File 'lib/livejournal/basic.rb', line 41 def server @server end |
#usejournal ⇒ Object
Set usejournal to log in as user username but act as user usejournal. For example, to work with a community you own.
44 45 46 |
# File 'lib/livejournal/basic.rb', line 44 def usejournal @usejournal end |
#username ⇒ Object
parameter when creating a User
41 42 43 |
# File 'lib/livejournal/basic.rb', line 41 def username @username end |
Instance Method Details
#journal ⇒ Object
56 57 58 |
# File 'lib/livejournal/basic.rb', line 56 def journal @usejournal || @username end |
#to_s ⇒ Object
59 60 61 |
# File 'lib/livejournal/basic.rb', line 59 def to_s "#{@username}: '#{@fullname}'" end |