Class: NJTransit::Resources::BusGTFS
- Defined in:
- lib/njtransit/resources/bus_gtfs.rb
Constant Summary collapse
- DEFAULT_PREFIX =
"/api/GTFS"
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#alerts ⇒ Object
Returns GTFS-RT alerts as protobuf binary.
-
#initialize(client, api_prefix: DEFAULT_PREFIX) ⇒ BusGTFS
constructor
A new instance of BusGTFS.
-
#schedule_data ⇒ Object
Returns GTFS static schedule data as ZIP binary.
-
#trip_updates ⇒ Object
Returns GTFS-RT trip updates as protobuf binary.
-
#vehicle_positions ⇒ Object
Returns GTFS-RT vehicle positions as protobuf binary.
Constructor Details
#initialize(client, api_prefix: DEFAULT_PREFIX) ⇒ BusGTFS
Returns a new instance of BusGTFS.
8 9 10 11 |
# File 'lib/njtransit/resources/bus_gtfs.rb', line 8 def initialize(client, api_prefix: DEFAULT_PREFIX) super(client) @api_prefix = api_prefix end |
Instance Method Details
#alerts ⇒ Object
Returns GTFS-RT alerts as protobuf binary
19 20 21 |
# File 'lib/njtransit/resources/bus_gtfs.rb', line 19 def alerts client.post_form_raw("#{@api_prefix}/getAlerts") end |
#schedule_data ⇒ Object
Returns GTFS static schedule data as ZIP binary
14 15 16 |
# File 'lib/njtransit/resources/bus_gtfs.rb', line 14 def schedule_data client.post_form_raw("#{@api_prefix}/getGTFS") end |
#trip_updates ⇒ Object
Returns GTFS-RT trip updates as protobuf binary
24 25 26 |
# File 'lib/njtransit/resources/bus_gtfs.rb', line 24 def trip_updates client.post_form_raw("#{@api_prefix}/getTripUpdates") end |
#vehicle_positions ⇒ Object
Returns GTFS-RT vehicle positions as protobuf binary
29 30 31 |
# File 'lib/njtransit/resources/bus_gtfs.rb', line 29 def vehicle_positions client.post_form_raw("#{@api_prefix}/getVehiclePositions") end |