Class: ModSpox::Handlers::LuserClient
- Defined in:
- lib/mod_spox/handlers/LuserClient.rb
Instance Method Summary collapse
-
#initialize(handlers) ⇒ LuserClient
constructor
A new instance of LuserClient.
- #process(string) ⇒ Object
Methods inherited from Handler
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 |