Class: IRC::Client::User

Inherits:
Object show all
Defined in:
lib/failirc/client/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.



29
30
31
32
33
# File 'lib/failirc/client/user.rb', line 29

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.



27
28
29
# File 'lib/failirc/client/user.rb', line 27

def channel
  @channel
end

#clientObject (readonly)

Returns the value of attribute client.



27
28
29
# File 'lib/failirc/client/user.rb', line 27

def client
  @client
end

#modesObject (readonly)

Returns the value of attribute modes.



27
28
29
# File 'lib/failirc/client/user.rb', line 27

def modes
  @modes
end

Instance Method Details

#hostObject



51
52
53
# File 'lib/failirc/client/user.rb', line 51

def host
    @client.host
end

#inspectObject



59
60
61
# File 'lib/failirc/client/user.rb', line 59

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

#maskObject



35
36
37
# File 'lib/failirc/client/user.rb', line 35

def mask
    @client.mask
end

#nickObject



43
44
45
# File 'lib/failirc/client/user.rb', line 43

def nick
    @client.nick
end

#serverObject



39
40
41
# File 'lib/failirc/client/user.rb', line 39

def server
    @client.server
end

#to_sObject



55
56
57
# File 'lib/failirc/client/user.rb', line 55

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

#userObject



47
48
49
# File 'lib/failirc/client/user.rb', line 47

def user
    @client.user
end