Class: ModSpox::Handlers::Pong

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

Instance Method Summary collapse

Constructor Details

#initialize(handlers) ⇒ Pong

Returns a new instance of Pong.



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

def initialize(handlers)
    handlers[:PONG] = self
end

Instance Method Details

#process(string) ⇒ Object



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

def process(string)
    if(string =~ /^:\S+\sPONG\s(\S+)\s:(.+)$/)
        return Messages::Incoming::Pong.new(string, $1, $2)
    else
        Logger.log('Failed to parse PONG message')
    end
end