Class: ModSpox::Handlers::NickInUse

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

Instance Method Summary collapse

Methods inherited from Handler

#preprocess

Constructor Details

#initialize(handlers) ⇒ NickInUse

Returns a new instance of NickInUse.



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

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

Instance Method Details

#process(string) ⇒ Object



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

def process(string)
    if(string =~ /#{ERR_NICKNAMEINUSE}\s\S+\s(\S+)\s:/)
        return Messages::Incoming::NickInUse.new(string, $1)
    else
        Logger.warn('Failed to parse ERR_NICKNAMEINUSE message')
        return nil
    end
end