# File lib/rev/server.rb, line 14
14:     def initialize(listen_socket, klass = Socket, *args, &block)
15:       # Ensure the provided class responds to attach
16:       unless klass.allocate.is_a? IOWatcher
17:         raise ArgumentError, "provided class must descend from IOWatcher"
18:       end
19: 
20:       # Verify the arity of the provided arguments
21:       arity = klass.instance_method(:initialize).arity
22:       expected = arity >= 0 ? arity : -(arity + 1)
23: 
24:       if (arity >= 0 and args.size + 1 != expected) or (arity < 0 and args.size + 1 < expected)
25:         raise ArgumentError, "wrong number of arguments for #{klass}#initialize (#{args.size+1} for #{expected})" 
26:       end
27:      
28:       @klass, @args, @block = klass, args, block
29:       super(listen_socket)
30:     end