Pecoes Wiki
Advertisement

Namespace RailgunServer

A wrapper object for all Railgun server methods. The main method is
processRequest(), which is the server's message event handler. The event handler
delegates various client requests to the other methods in the namespace.

Field Summary
Field AttributesField Name and Description
<static>  
RailgunServer.isDebug
true if the server is in debug mode, false otherwise
<static>  
RailgunServer.keys
A list of keys associated with localStorage data.
<static>  
RailgunServer.version
The version of the Railgun server source code.

Method Summary

Method AttributesMethod Name and Description
<static>  
RailgunServer.getItem(key)
Retrieves a single item from localStorage.
<static>  
RailgunServer.processRequest(event)
The Railgun server's message event listener which processes requests made&#13;by the Railgun client.
<static>  
RailgunServer.reset()
Removes all items from localStorage associated with native list of keys.
<static>  
RailgunServer.retrieve()
Retrieves all items from localStorage associated with the native list of keys.
<static>  
RailgunServer.setItem(key, value)
Associates a value with a given key in localStorage.

Field Detail

<static> {Boolean}RailgunServer.isDebug
true if the server is in debug mode, false otherwise
Default Value:
false
<static> {Array}RailgunServer.keys
A list of keys associated with localStorage data.
Default Value:
["friends", "siderailHidden"]
<static> {String}RailgunServer.version
The version of the Railgun server source code.

Method Detail

  • <static> RailgunServer.getItem(key)
    Retrieves a single item from localStorage.
    Parameters:
    {String} key
    the key to query localStorage for
    Returns:
    the JSON.parsed value associated with the given key
  • <static> RailgunServer.processRequest(event)
    The Railgun server's message event listener which processes requests made&#13;by the Railgun client. This method reads instructions from the client,&#13;delegates the task to an appropriate method, and then sends the server's&#13;response back to the client. To make a request, the client must send the&#13;server a JSON.stringified request object with instruction, key and value&#13;properties: { instruction : "setItem", key : "siderailHidden",&#13;value : true }
    Parameters:
    {MessageEvent} event
    an event corresponding to a postMessage&#13;request made by the client
  • <static> RailgunServer.reset()
    Removes all items from localStorage associated with native list of keys.
    See:
    RailgunServer.keys
  • <static> {Object}RailgunServer.retrieve()
    Retrieves all items from localStorage associated with the native list of keys.
    Returns:
    {Object} a mapping of (key, value) pairs in localStorage
    See:
    RailgunServer.keys
  • <static> {Boolean}RailgunServer.setItem(key, value)
    Associates a value with a given key in localStorage.
    Parameters:
    {String} key
    a key to associate with the given value
    value
    some value of arbitrary type to be stored
    Returns:
    {Boolean} true if the operation was successful&#13;false otherwise
Documentation generator: JsDoc Toolkit 2.4.0
Template: Codeview 1.2
Generated on: 2012-5-30 23:16
Advertisement