Borges::Registry (Class)

In: lib/Borges/RequestHandler/Registry.rb
Parent: Object

A Registry dispatches requests by key to registered handlers. A URL for the handler is given when the handler is registered.

Constants

HANDLER_KEY_SEPARATOR = '/@'
  A special token that separates the path part of the URL from the handler key.

Attributes

base_path  [RW]  The base path of Borges for outbound pages.

Public Class methods

Creates a new Registry for handling requests.

Public Instance methods

Empty all the handlers for this registry.

Collects and removes expired request handlers.

XXX We‘ve gotta do something better than this - ab

Performs a default action for req. This method must be overridden in subclasses.

A request for an expired handler gets passed to the handle_default_request.

Passes req off to the handler for req’s handler key, invoking the expired request handler if the found handler is no longer active or missing.

Finds a handler for req, invoking the default request handler if req does not have a handler key.

Registers handler, returning a key to use to retrieve it.

Removes handler from the registered request handlers.

Returns a URL for the request handler handler at path, or @base_path.

[Validate]