set_service_hook

set_service_hook(&handler)
Instance Public methods

A service-hook is called for each service request (RPC).

You can use a service-hook for example to wrap existing methods and catch exceptions of them or convert values to values recognized by XMLRPC.

You can disable it by passing nil as the handler parameter.

The service-hook is called with a Proc object along with any parameters.

An example:

server.set_service_hook {|obj, *args|
  begin
    ret = obj.call(*args)  # call the original service-method
    # could convert the return value
  rescue
    # rescue exceptions
  end
}
doc_ruby_on_rails
2015-06-13 15:32:41
Comments
Leave a Comment

Please login to continue.