new <abstract> RightTrackAgency( [ moduleDirectory [, configuration ] ] )

Description

RightTrackAgency Abstract Class

This abstract class is implemented by various Right Track Agencies which provide the agency-specific configuration information and real-time status information.

The abstract class handles the agency configuration properties and the reading of additional agency configuration files. An implementation of this class should override the feed-related functions to provide a real-time Station Feed.

Module: classes/RightTrackAgency

Parameters
Name Type Attributes Description
moduleDirectory string <optional>

The full path to the root of the agency's module directory. This is where relative paths to configuration files will be relative to.

configuration Object <optional>

The Agency configuration settings

Members


id

Description

The Agency's id code

Returns

name

Description

The Agency's full name

Returns

moduleDirectory

Description

The Agency's module directory

Returns

config

Description

The Agency's configuration properties

Returns

Methods


resetConfig()

Description

Reset the agency configuration to the default values


readConfig( configFile )

Description

Read an additional agency configuration file

Parameters
Name Type Description
configFile string

Path to agency configuration file. Relative paths will be relative to the root of the agency's module directory.


getConfig() → {object}

Description

Get the agency configuration

Returns

Agency configuration


<abstract> isFeedSupported() → {boolean}

Description

Check if the Agency supports real-time Station Feeds.

This will return false by default unless the implementing agency overrides the function to indicate support for Station Feeds.

Returns

true if the agency has implemented Station Feeds


<abstract> loadFeed( db, origin, callback )

Description

Load the Agency's Station Feed for the specified Origin Stop.

This function will need to be overridden by the implementing agency.

Parameters
Name Type Description
db RightTrackDB

The Right Track DB to query

origin Stop

The origin Stop

callback function

Callback function

Name Type Attributes Description
error Error

Station Feed Error. The Error's message will be a pipe (|) separated string in the format of: Error Code|Error Type|Error Message that will be parsed out by the Right Track API Server into a more specific error Response.

feed StationFeed <optional>

The built StationFeed for the Stop