Class: IRC::Server::User

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, channel, modes = Modes.new) ⇒ User

Returns a new instance of User.



27
28
29
30
31
# File 'lib/failirc/server/user.rb', line 27

def initialize (client, channel, modes=Modes.new)
    @client  = client
    @channel = channel
    @modes   = modes
end

Instance Attribute Details

#channelObject (readonly)

Returns the value of attribute channel.



25
26
27
# File 'lib/failirc/server/user.rb', line 25

def channel
  @channel
end

#clientObject (readonly)

Returns the value of attribute client.



25
26
27
# File 'lib/failirc/server/user.rb', line 25

def client
  @client
end

#modesObject (readonly)

Returns the value of attribute modes.



25
26
27
# File 'lib/failirc/server/user.rb', line 25

def modes
  @modes
end

Instance Method Details

#hostObject



49
50
51
# File 'lib/failirc/server/user.rb', line 49

def host
    @client.host
end

#inspectObject



65
66
67
# File 'lib/failirc/server/user.rb', line 65

def inspect
    return "#<User: #{client.inspect} #{channel.inspect} #{modes.inspect}>"
end

#maskObject



33
34
35
# File 'lib/failirc/server/user.rb', line 33

def mask
    @client.mask
end

#nickObject



41
42
43
# File 'lib/failirc/server/user.rb', line 41

def nick
    @client.nick
end

#realNameObject



53
54
55
# File 'lib/failirc/server/user.rb', line 53

def realName
    @client.realName
end

#send(type, *args) ⇒ Object



57
58
59
# File 'lib/failirc/server/user.rb', line 57

def send (type, *args)
    @client.send(type, *args)
end

#serverObject



37
38
39
# File 'lib/failirc/server/user.rb', line 37

def server
    @client.server
end

#to_sObject



61
62
63
# File 'lib/failirc/server/user.rb', line 61

def to_s
    return "#{modes[:level]}#{nick}"
end

#userObject



45
46
47
# File 'lib/failirc/server/user.rb', line 45

def user
    @client.user
end