Class: Borges::CallbackStore

# Borges::CallbackStore (Class)

In: | lib/Borges/Callback/CallbackStore.rb
Parent: | Object

Borges::CallbackStore holds callbacks for processing. Callbacks are called in HTML order. Only one ActionCallback is called.

## Methods

action evaluate new process_request register_action_callback register_callback register_dispatch_callback sort_request store value_for_field

## Public Class methods

new()

Creates a new Borges::CallbackStore

## Public Instance methods

action(&action_callback)

Sets `action_callback` as the ActionCallback to run when form processing is finished.

evaluate(key, input)

Run a `callback`, passing it `obj`. Raises Borges::CallbackNotFound if the application writer made a boo-boo, like not specifying a radio_group for radio_buttons.

process_request(req)

Processes the form fields from `req`, calling all appropriate callbacks, then returns the result of an action callback, if any.

register_action_callback(&block)

Registers a Borges::ActionCallback that will run `block`.

register_callback(&block)

Registers a Borges::ValueCallback that will run `block`. ValueCallbacks may take an argument.

register_dispatch_callback()

Registers a Borges::DispatchCallback that will act as a placeholder for a ValueCallback.

sort_request(fields)

Sorts the `fields` of the request to be processed. `fields` must be an Enumerable that yields two values.

store(callback)

Stores `callback` in the CallbackStore, and returns its index.

value_for_field(field)

Converts `field` into an appropriate String representation.

[Validate]