Class: ModSpox::Handlers::LuserMe

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

Instance Method Summary collapse

Methods inherited from Handler

#preprocess

Constructor Details

#initialize(handlers) ⇒ LuserMe

Returns a new instance of LuserMe.



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

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

Instance Method Details

#process(string) ⇒ Object



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

def process(string)
    clients = string =~ /(\d+) clients/ ? $1.to_i : 0
    servers = string =~ /(\d+) server/ ? $1.to_i : 0
    return Messages::Incoming::LuserMe.new(string, clients, servers)
end