Class: Participle::DA::User

Inherits:
Object
  • Object
show all
Defined in:
lib/user.rb

Overview

Represents a user connected to dAmn.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (User) initialize(nick, admin)



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)



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?



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