Installation

Usage

Minimal example

The most basic example involves the definition of a handler class first:

classMyHandler# A greeting method.
# @param people [String] the people to greet
# @return [String] the greeting
defhello(people)"Hello, #{people}!"endend

The class does not need to include any module or implement a specific API; however, its methods need to be
properly documented (following the YARD conventions) to take advantage of the built-in
introspection (more on that later).

Once the handler is defined, it can be added to a standard Sinatra application by registering the
Sinatra::RPC extension.

Echo server and introspection

The RPC server implements the commonly adopted introspection interface for XML-RPC: the system.listMethods,
system.methodHelp and system.methodSignature methods are automatically available. The metadata is only extracted
from the YARD-style comments in the handler classes, so expect inaccurate results if the code is not completely
documented.

Another facility is a simple test.echo method, which just return the passed argument.