Přehled objektů a a metod Borges obohacený o poznámky a komentáře.
modul Borges
register_application(name, entry_point=nil, &block)Zaregistrování nové aplikace. Aplikace se registruje pod jménem name přes které se k ní přistupuje. Příklad
class Hello < Page
def render_on(r)
r.heading "Hello world!"
end
end
Borges::register_application("hello", Hello)root_application=(name)Accessing '/' will redirect to application name
respondGrab the Session for this thread and ...
render(&block)FIXME:
třída Borges::Application
Apps — hashHash/Asociativní pole/Slovník.
handle_request(request, response)Create a new session for this request if the session_key does not exist. Otherwise pass the request to the session and set the response's session_key to the request's session_key.
new_session(response)Create a new session, and set the response's session_key.
modul Borges::ApacheDRbClient
self.handle_with(server_uri)Pass this request off to the DRb Server.
třída Borges::ApacheDRbServer
self.start(drb_uri)Start up the DRb server.
self.install_INT_handlerInstall a SIGINT handler, so DRb will shut down cleanly on ctrl-c
handle_request(request)Pass the request off to Borges for processing, returns the response. Přesměruje/předá request do Borges voláním
Borges::Application.handle_request(request, response)
Objekt response s odpovědí pak vrátí jako návratovou hodnotu.
Třída Borges::Page
goFIXME: doplnit
render_on(r, embeded=false)Metoda vykresluje stránku (celou) do r. Druhý parametr označuje zdali vykreslujeme celou stránku false nebo jen její část true. Bez uvedení tohoto parametru se předpokládá vykreslení celé stránky.
on_head(r)FIXME: doplnit
on_body(r)Metoda vykresluje tělo stránky na r. Tato metoda musí být v podtřídě předefinována, jinak vyvolá chybu.
answer(return_val=nil)FIXME: doplnit
Třída Borges::Session
initialize(app)Create a new session for app.
handle_request(request, response)Set up the Session's thread for execution, and dispatch.
respondTake the continuation and save it in the cache. ...
expireKill this thread.
handle_request_intern(request, response) — private methodHandle a request, dispatching to the request's action_key, if such a key exists in the hash, otherwise start the application from the beginning.
Called by the public handle request.
unknown_request(request) — private methodStart this request over.
handle_error(err) — private methodSpit out a backtrace for the Exception err.
Třída Borges::Renderer
render_responseRender the page and dispatch the callback for the clicked action.
submit(attrs={}, &action)Render tag submit.
Třída Borges::CallbackStore
process_callbacks(request)Run the action the user clicked.
