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