Class: TtcUrls
- Inherits:
-
Object
- Object
- TtcUrls
- Defined in:
- lib/ttc_feed/ttc_urls.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
Returns the value of attribute base.
Instance Method Summary collapse
-
#initialize(agency_tag = "ttc") ⇒ TtcUrls
constructor
A new instance of TtcUrls.
-
#predictions(stop_id, route_tag) ⇒ Object
stop_id = “14935” route_tag = “512”.
-
#route_config(route_tag) ⇒ Object
route_tag = “512”.
- #route_list ⇒ Object
-
#vehicle_locations(route_tag, last_timestamp = nil) ⇒ Object
route_tag = “512”.
Constructor Details
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base.
5 6 7 |
# File 'lib/ttc_feed/ttc_urls.rb', line 5 def base @base end |
Instance Method Details
#predictions(stop_id, route_tag) ⇒ Object
stop_id = “14935” route_tag = “512”
23 24 25 |
# File 'lib/ttc_feed/ttc_urls.rb', line 23 def predictions(stop_id, route_tag) @base.stopId(stop_id).r(route_tag).a(@agency_tag).to_s end |
#route_config(route_tag) ⇒ Object
route_tag = “512”
17 18 19 |
# File 'lib/ttc_feed/ttc_urls.rb', line 17 def route_config(route_tag) @base.command("routeConfig").a(@agency_tag).r(route_tag).to_s end |
#route_list ⇒ Object
12 13 14 |
# File 'lib/ttc_feed/ttc_urls.rb', line 12 def route_list @base.command("routeList").a(@agency_tag).to_s end |
#vehicle_locations(route_tag, last_timestamp = nil) ⇒ Object
route_tag = “512”
28 29 30 31 32 |
# File 'lib/ttc_feed/ttc_urls.rb', line 28 def vehicle_locations(route_tag, = nil) url = @base.command("vehicleLocations").a(@agency_tag).r(route_tag) url = url.t() if url.to_s end |