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
Constructor Details
#initialize(handlers) ⇒ Quit
Returns a new instance of Quit.
4 5 6 |
# File 'lib/mod_spox/handlers/Quit.rb', line 4 def initialize(handlers) handlers[:QUIT] = self end |
Instance Method Details
#process(string) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/mod_spox/handlers/Quit.rb', line 7 def process(string) if(string =~ /^:(\S+)\sQUIT\s:(.+)$/) reason = $2 nick = find_model($1.gsub(/!.+$/, '')) nick.clear_channels nick.visible = false nick.save return Messages::Incoming::Quit.new(string, nick, reason) else Logger.log('Failed to parse KICK message') end end |