Class Iowa::Session
In: src/Session.rb
Parent: Object

Represents a session between the application and the user.

Methods

Attributes

application  [RW]  Define an accessor to make the context object accessible to the application’s code.
context  [RW]  Define an accessor to make the context object accessible to the application’s code.
currentPage  [RW]  Define an accessor to make the context object accessible to the application’s code.
notes  [RW]  Define an accessor to make the context object accessible to the application’s code.
pages  [RW]  Define an accessor to make the context object accessible to the application’s code.
requestCount  [RW]  Define an accessor to make the context object accessible to the application’s code.
resourceCount  [RW]  Define an accessor to make the context object accessible to the application’s code.

Public Class methods

Set the @cachedPages class variable.

Initialize the state of the session.

Constructor to return a new instance of @@sessionClass.

Public Instance methods

Handles the current request from the browser. Essentially all that is happening is thread synchronizations along with some tests to make sure that all the data necessary to handle the request exists. Then the call to handleRequest gets passed on to the object representing the current page.

Invokes the handleResponse() method on the object representing the page and updates the page cache.

resourceUrl(*args,&block)

Alias for resource_url

If one passes into resource_url content of some sort plus an optional content type (default is application/data if not specified), it will return a URL that can be used to access that content. If, on the other hand, one passes an arbitrary set of arguments and a block, a url will be returned that, when accesed, will cause the block to be executed. If the block returns an instance of Iowa::Resource, the content in the resource will be returned as a result of calling that URL, with the content type specified in the resource object. Any other return value will have that value returned as the result of calling the URL, with a content type of ‘application/data’. The resources are tied to the page that created them, so they are available until the page expires. Once the page expires, the resource is deleted as well.

[Validate]