Class: ModSpox::Handlers::YourHost

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

Instance Method Summary collapse

Methods inherited from Handler

#preprocess

Constructor Details

#initialize(handlers) ⇒ YourHost

Returns a new instance of YourHost.



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

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

Instance Method Details

#process(string) ⇒ Object



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

def process(string)
    if(string =~ /:Your host is (\S+), running version (.+)$/)
        return Messages::Incoming::YourHost.new(string, $1, $2)
    else
        Logger.warn('Failed to match Your Host message')
        return nil
    end
end