Class: MessageFactory::Handlers::Bounce
- Defined in:
- lib/handlers/Bounce.rb
Instance Method Summary collapse
-
#process(string) ⇒ Object
- string
-
string to process Create a new BadNick message OpenStruct will contain: #type #direction #raw #received #server #port :nodoc:.
-
#types_process ⇒ Object
Returns type(s) supported.
Instance Method Details
#process(string) ⇒ Object
- string
-
string to process
Create a new BadNick message OpenStruct will contain: #type #direction #raw #received #server #port :nodoc:
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/handlers/Bounce.rb', line 15 def process(string) m = nil begin m = mk_struct(string) m.type = :bounce orig = string.dup 2.times{string.slice!(0..string.index(' '))} server = string.slice!(0..string.index(',')-1) string.slice!(0..string.index(' ',4)) m.server = server m.port = string rescue Object => boom raise "Failed to parse Bounce string: #{orig}" end m end |
#types_process ⇒ Object
Returns type(s) supported
6 7 8 |
# File 'lib/handlers/Bounce.rb', line 6 def types_process :'005' end |