Class: ModSpox::Handlers::MyInfo

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

Instance Method Summary collapse

Constructor Details

#initialize(handlers) ⇒ MyInfo

Returns a new instance of MyInfo.



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

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

Instance Method Details

#process(string) ⇒ Object



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

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.log('Failed to match My Info message')
    end
end