Class: CamperVan::User
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Public: the user’s unix account name for user@host pairs in irc, mapped from the user’s email address.
-
#admin ⇒ Object
writeonly
Public: set the user’s admin state.
-
#id ⇒ Object
readonly
Public: the user’s campfire id.
-
#idle ⇒ Object
writeonly
Public: set the user’s idle state.
-
#name ⇒ Object
readonly
Public: the user’s campfire name.
-
#nick ⇒ Object
readonly
Public: the user’s irc nick.
-
#server ⇒ Object
readonly
Public: the user’s unix server name for user@host pairs in irc, mapped from the user’s email address.
Instance Method Summary collapse
-
#admin? ⇒ Boolean
Public: whether or not the user is an admin.
-
#idle? ⇒ Boolean
Public: whether the user is idle or not.
-
#initialize(user) ⇒ User
constructor
Public: create a new user from a campfire user definition.
Methods included from Utils
Constructor Details
#initialize(user) ⇒ User
Public: create a new user from a campfire user definition.
Initializes the user’s fields based on the campfire user info.
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/camper_van/user.rb', line 48 def initialize(user) @id = user.id @name = user.name if user.email_address @account, @server = user.email_address.split("@") else @account = @server = "unknown" end @nick = irc_name user.name @idle = false @admin = user.admin end |
Instance Attribute Details
#account ⇒ Object (readonly)
Public: the user’s unix account name for user@host pairs in irc, mapped from the user’s email address
18 19 20 |
# File 'lib/camper_van/user.rb', line 18 def account @account end |
#admin=(value) ⇒ Object (writeonly)
Public: set the user’s admin state
admin - true/false
43 44 45 |
# File 'lib/camper_van/user.rb', line 43 def admin=(value) @admin = value end |
#id ⇒ Object (readonly)
Public: the user’s campfire id
8 9 10 |
# File 'lib/camper_van/user.rb', line 8 def id @id end |
#idle=(value) ⇒ Object (writeonly)
Public: set the user’s idle state.
is_idle - true/false
33 34 35 |
# File 'lib/camper_van/user.rb', line 33 def idle=(value) @idle = value end |
#name ⇒ Object (readonly)
Public: the user’s campfire name
11 12 13 |
# File 'lib/camper_van/user.rb', line 11 def name @name end |
#nick ⇒ Object (readonly)
Public: the user’s irc nick
14 15 16 |
# File 'lib/camper_van/user.rb', line 14 def nick @nick end |
#server ⇒ Object (readonly)
Public: the user’s unix server name for user@host pairs in irc, mapped from the user’s email address
22 23 24 |
# File 'lib/camper_van/user.rb', line 22 def server @server end |
Instance Method Details
#admin? ⇒ Boolean
Public: whether or not the user is an admin
36 37 38 |
# File 'lib/camper_van/user.rb', line 36 def admin? @admin end |
#idle? ⇒ Boolean
Public: whether the user is idle or not. Updated by campfire Idle/Unidle messages
26 27 28 |
# File 'lib/camper_van/user.rb', line 26 def idle? @idle end |