Class: ModSpox::Handlers::LuserOp

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

Instance Method Summary collapse

Methods inherited from Handler

#preprocess

Constructor Details

#initialize(handlers) ⇒ LuserOp

Returns a new instance of LuserOp.



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

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

Instance Method Details

#process(string) ⇒ Object



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

def process(string)
    if(string =~ /(\d+) :.*?\s*[oO]perators/)
        return Messages::Incoming::LuserOp.new(string, $1.to_i)
    else
        Logger.warn('Failed to match RPL_LUSEROP message')
        return nil
    end
end