diff --git a/sgx-catapult.rb b/sgx-catapult.rb index 410afc1352ebcf19560277ddd020bcad520cd322..d5b87fde7d380d22ff2f4d3015643098850001df 100755 --- a/sgx-catapult.rb +++ b/sgx-catapult.rb @@ -48,12 +48,12 @@ end class SGXClient < Blather::Client def register_handler(type, *guards, &block) - super(type, *guards) { |stanza| wrap_handler(stanza, &block) } + super(type, *guards) { |*args| wrap_handler(*args, &block) } end def register_handler_before(type, *guards, &block) check_handler(type, guards) - handler = lambda { |stanza| wrap_handler(stanza, &block) } + handler = lambda { |*args| wrap_handler(*args, &block) } @handlers[type] ||= [] @handlers[type].unshift([guards, handler]) @@ -61,8 +61,8 @@ class SGXClient < Blather::Client protected - def wrap_handler(stanza, &block) - v = block.call(stanza) + def wrap_handler(*args, &block) + v = block.call(*args) v.catch(&method(:panic)) if v.is_a?(Promise) true # Do not run other handlers unless throw :pass rescue Exception => e