Class: Participle::DA::User
- Inherits:
-
Object
- Object
- Participle::DA::User
- Defined in:
- lib/user.rb
Overview
Represents a user connected to dAmn.
Instance Attribute Summary (collapse)
-
- (String) nick
readonly
The user's name.
Instance Method Summary (collapse)
-
- (Boolean) ===(nick)
Is the user's name nick?.
-
- (Boolean) admin?
Whether the user is an administrator.
-
- (User) initialize(nick, admin)
constructor
A new instance of User.
- - (String) to_s
Constructor Details
- (User) initialize(nick, admin)
A new instance of User
11 12 13 14 |
# File 'lib/user.rb', line 11 def initialize nick, admin @nick = nick @admin = admin end |
Instance Attribute Details
- (String) nick (readonly)
The user's name
7 8 9 |
# File 'lib/user.rb', line 7 def nick @nick end |
Instance Method Details
- (Boolean) ===(nick)
Is the user's name nick?
28 29 30 |
# File 'lib/user.rb', line 28 def ===(nick) @nick == nick end |
- (Boolean) admin?
Whether the user is an administrator
17 18 19 |
# File 'lib/user.rb', line 17 def admin? @nick == @admin end |
- (String) to_s
22 23 24 |
# File 'lib/user.rb', line 22 def to_s "#<#@nick:DA::User>" end |