Class: ModSpox::Handlers::Quit
- Defined in:
- lib/mod_spox/handlers/Quit.rb
Instance Method Summary collapse
-
#initialize(handlers) ⇒ Quit
constructor
A new instance of Quit.
-
#process(string) ⇒ Object
:spox!~spox@host QUIT :Ping timeout.
Methods inherited from Handler
Constructor Details
#initialize(handlers) ⇒ Quit
Returns a new instance of Quit.
5 6 7 |
# File 'lib/mod_spox/handlers/Quit.rb', line 5 def initialize(handlers) handlers[:QUIT] = self end |
Instance Method Details
#process(string) ⇒ Object
:spox!~spox@host QUIT :Ping timeout
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/mod_spox/handlers/Quit.rb', line 10 def process(string) orig = string.dup string = string.dup begin string.slice!(0) nick = find_model(string.slice!(0..string.index('!')-1)) string.slice!(0..string.index(':')) nick.remove_all_channels nick.visible = false nick.save return Messages::Incoming::Quit.new(orig, nick, string) rescue Object => boom Logger.error("Failed to parse QUIT message: #{orig}") raise boom end end |