Class: MessageFactory::Handlers::Bounce

Inherits:
Handler
  • Object
show all
Defined in:
lib/messagefactory/handlers/005.rb

Instance Method Summary collapse

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/messagefactory/handlers/005.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_processObject

Returns type(s) supported



6
7
8
# File 'lib/messagefactory/handlers/005.rb', line 6

def types_process
    :'005'
end