new <abstract> RightTrackTransitAgency( moduleDirectory )

Description

RightTrackTransitAgency Abstract Class

This module provides the abstract class for all implementing Transit Agencies. It provides methods for managing the Transit Agency configuration, getting the required configuration properties, and loading a Transit Feed for the Transit Agency.

Module: classes/RightTrackTransitAgency

Parameters
Name Type Description
moduleDirectory string

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

Members


moduleDirectory

Description

The Transit Agency's module directory

Returns

config

Description

The Transit Agency's configuration properties

Returns

id

Description

Transit Agency's id code

Returns

name

Description

The Transit Agency's full name

Returns

description

Description

The Transit Agency's description

Returns

maintainer

Description

The Transit Agency's maintainer information

Returns

Methods


resetConfig()

Description

Reset the transit agency configuration to the default values


readConfig( configFile )

Description

Read an additional transit agency configuration file

Parameters
Name Type Description
configFile string

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


getConfig() → {object}

Description

Get the transit agency configuration

Returns

Transit Agency configuration


<abstract> loadFeed( callback )

Description

Load the Transit Feed for this Transit Agency

Parameters
Name Type Description
callback function

Callback function

Name Type Attributes Description
error Error

Transit 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 TransitFeed <optional>

The built TransitFeed for the Transit Agency


getDivision( divisionCodes, callback )

Description

Get the matching Transit Division from the Agency's Transit Feed

Parameters
Name Type Description
divisionCodes Array.<String>

List of Transit Division codes (in hierarchical order)

callback function

Callback function

Name Type Attributes Description
error Error

Transit Feed Error

division TransitDivision <optional>

The matching TransitDivision