Constructor
(abstract) new RightTrackAgency(moduleDirectoryopt, configurationopt)
Abstract class constructor. The implementing agency should call this
constructor: super(moduleDirectory)
in order to read the default
agency configuration and set the initial configuration properties.
This will set the following properties, which are accessible from the implementing agency's Class:
moduleDirectory
= the root of the agency's module directoryconfig
= the agency's configuration (the default configuration or the default merged with an additional configuration ifreadConfig
is used).id
= the agency id codename
= the agency's full name
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
config
The Agency's configuration properties
id
The Agency's id code
moduleDirectory
The Agency's module directory
name
The Agency's full name
Methods
getConfig() → {object}
Get the agency configuration
Returns:
Agency configuration
- Type
- object
(abstract) isFeedSupported() → {boolean}
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
- Type
- boolean
(abstract) loadFeed(db, origin, callback)
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 Properties
|
readConfig(configFile)
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. |
resetConfig()
Reset the agency configuration to the default values