method

add_handler

Importance_0
v1_9_3_125 - Show latest stable - 0 notes - Class: BasicServer
add_handler(prefix, obj_or_signature=nil, help=nil, &block) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/xmlrpc/server.rb, line 183
  def add_handler(prefix, obj_or_signature=nil, help=nil, &block)
    if block_given?
      # proc-handler
      @handler << [prefix, block, obj_or_signature, help]
    else
      if prefix.kind_of? String
        # class-handler
        raise ArgumentError, "Expected non-nil value" if obj_or_signature.nil?
        @handler << [prefix + @class_delim, obj_or_signature]
      elsif prefix.kind_of? XMLRPC::Service::BasicInterface
        # class-handler with interface
        # add all methods
        @handler += prefix.get_methods(obj_or_signature, @class_delim)
      else
        raise ArgumentError, "Wrong type for parameter 'prefix'"
      end
    end
    self
  end
Register or log in to add new notes.