Class: ModSpox::Handlers::YourHost

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

Instance Method Summary collapse

Constructor Details

#initialize(handlers) ⇒ YourHost

Returns a new instance of YourHost.



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

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

Instance Method Details

#process(string) ⇒ Object



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

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