Class: ModSpox::Handlers::MyInfo

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

Instance Method Summary collapse

Methods inherited from Handler

#preprocess

Constructor Details

#initialize(handlers) ⇒ MyInfo

Returns a new instance of MyInfo.



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

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

Instance Method Details

#process(string) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/mod_spox/handlers/MyInfo.rb', line 9

def process(string)
    if(string =~ /^:\S+ \S+ \S+ (\S+) (\S+) (\S+) (\S+)/)
        servername = $1
        version = $2
        usermodes = $3
        channelmodes = $4
        return Messages::Incoming::MyInfo.new(string, servername, version, usermodes, channelmodes)
    else
        Logger.warn('Failed to match My Info message')
        return nil
    end
end