Closed werebus closed 2 years ago
Do the instances where stop_id
is used need to now call .to_i
? Or is it implicitly called?
https://github.com/umts/bojangles/blob/dbbf54afc7c0b7b719a5b45fb3868a0a51b6f9b2/lib/avail.rb#L54-L56
Or is this a different thing?
Do the instances where stop_id is used need to now call .to_i? Or is it implicitly called?
This is an interesting question. Neither option is really "correct":
'place_UnSta'.to_i
is 0
, likewise with all the other "stations". There is no actual stop with id of 0, so you'll never get any departures that way.GET
request to https://bustracker.pvta.com/InfoPoint/rest/Stops/Get/place_UnSta
will get you a 400
(Bad Request) error. Apparently, trying to cast that string to an integer in .Net gets you null
. So, you can't get departures for these stops. That's OK-ish. They exist only to be parent_station
s for other stops. And of the two behaviors, I prefer the 400
because it tells the user right away that they've configured it bad.
This was necessitated by the current PVTA GTFS file
"Stop ID" was never guaranteed to be an integer in the spec, ans at some point the export started containing parent stations with ids like "
place_UnSta
".