Class: TransitionObject

TransitionObject()

Formalize the definition of a transition object. A Transition Object is a record that pairs a transition token with a session token and also that provides basic information about server side and client side operations necessary to coordinate a transition of state between the two.

Constructor

new TransitionObject()

Source:

Methods

add_extra_field(fld)

The fields returned from to_object are by default just a few provided by the base classs. For TransitionObject these are just the following: "token", "secondary_action", "session_token", "type" Use this method to add more field to be included in the to_object report.

Parameters:
Name Type Description
fld string
Source:

add_extra_fields(fld_list)

Call add_extra_field for each member of the fld_list parameter.

Parameters:
Name Type Description
fld_list Array.<string>
Source:

add_to_elements(obj)

Extend the elements object with more fields and info. These may overwrite existing fields.

Parameters:
Name Type Description
obj object
Source:

clear_session(token)

If this token has been assigned to a session, then erase the session identifier and replace it with a message of abandonment, 'sess+gone'.

Parameters:
Name Type Description
token string
Source:

set_session(sess_id)

Set the session id with the expectation that this assertion declares that the token belong to a session.

Parameters:
Name Type Description
sess_id string
Source:

set_token(token)

Fix the token of this object.

Parameters:
Name Type Description
token string
Source:

to_object(extrasopt) → {object}

Returns an object without class information containing a minimal set of top level fields refering to current values. If the extras parameter is supplied, this method assumes that it is an array of field names. The extra field will be added to the object produced by this method.

Parameters:
Name Type Attributes Description
extras Array.<string> <optional>
Source:
Returns:
Type
object