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