Class: ModSpox::Handlers::LuserClient

Inherits:
Handler
  • Object
show all
Defined in:
lib/mod_spox/handlers/LuserClient.rb

Instance Method Summary collapse

Methods inherited from Handler

#preprocess

Constructor Details

#initialize(handlers) ⇒ LuserClient

Returns a new instance of LuserClient.



5
6
7
# File 'lib/mod_spox/handlers/LuserClient.rb', line 5

def initialize(handlers)
    handlers[RPL_LUSERCLIENT] = self
end

Instance Method Details

#process(string) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/mod_spox/handlers/LuserClient.rb', line 8

def process(string)
    users = string =~ /(\d+) users/ ? $1 : 0
    invis = string =~ /(\d+) invisible/ ? $1 : 0
    servs = string =~ /(\d+) servers/ ? $1 : 0
    services = string =~ /(\d+) services/ ? $1 : 0
    return Messages::Incoming::LuserClient.new(string, users, invis, servs, services)
end