Class: NJTransit::Resources::Rail

Inherits:
Base
  • Object
show all
Defined in:
lib/njtransit/resources/rail.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from NJTransit::Resources::Base

Instance Method Details

#station_messages(station: nil, line: nil) ⇒ Object



10
11
12
13
# File 'lib/njtransit/resources/rail.rb', line 10

def station_messages(station: nil, line: nil)
  post_form("/api/TrainData/getStationMSG",
            station: station || "", line: line || "")
end

#station_schedule(station:, njtonly: "1") ⇒ Object



15
16
17
18
# File 'lib/njtransit/resources/rail.rb', line 15

def station_schedule(station:, njtonly: "1")
  post_form("/api/TrainData/getStationSchedule",
            station: station, NJT_Only: njtonly)
end

#stationsObject



6
7
8
# File 'lib/njtransit/resources/rail.rb', line 6

def stations
  post_form("/api/TrainData/getStationList")
end

#train_schedule(station:, njtonly: "1") ⇒ Object



20
21
22
23
# File 'lib/njtransit/resources/rail.rb', line 20

def train_schedule(station:, njtonly: "1")
  post_form("/api/TrainData/getTrainSchedule",
            station: station, NJT_Only: njtonly)
end

#train_schedule_19(station:, njtonly: "1") ⇒ Object



25
26
27
28
# File 'lib/njtransit/resources/rail.rb', line 25

def train_schedule_19(station:, njtonly: "1")
  post_form("/api/TrainData/getTrainSchedule19Rec",
            station: station, NJT_Only: njtonly)
end

#train_stop_list(train_id:) ⇒ Object



30
31
32
33
# File 'lib/njtransit/resources/rail.rb', line 30

def train_stop_list(train_id:)
  post_form("/api/TrainData/getTrainStopList",
            trainID: train_id)
end

#vehicle_dataObject



35
36
37
# File 'lib/njtransit/resources/rail.rb', line 35

def vehicle_data
  post_form("/api/TrainData/getVehicleData")
end