Class: CTA::Bus
Overview
Note:
Current columns: [:route_id, :service_id, :trip_id, :direction_id, :block_id, :shape_id, :direction, :wheelchair_accessible, :schd_trip_id]
A Sequel::Model, inherited from Trip This corresponds to trips.txt in the GTFS feed, though the CTA does not fully implement the standard.
Defined Under Namespace
Classes: Live, Prediction
Constant Summary
Constants inherited from Trip
Trip::BUS_ROUTES, Trip::L_ROUTES
Instance Attribute Summary collapse
Instance Method Summary collapse
- #block_id ⇒ Integer
- #direction ⇒ String
- #direction_id ⇒ Integer
-
#predictions!(options = {}) ⇒ CTA::BusTracker::PredictionsResponse
Returns predictions for this Bus.
- #route_id ⇒ String (also: #id)
- #schd_trip_id ⇒ String (also: #scheduled_trip_id, #run)
- #service_id ⇒ Integer
- #shape_id ⇒ Integer
- #trip_id ⇒ Integer
- #wheelchair_accessible ⇒ true, false
Methods inherited from Trip
#calendar, find_active_run, #route, #stop_times, #stops
Instance Attribute Details
#live ⇒ Live
Note:
a CTA::Bus will only contain live data when augmented with an API::Response
Returns the Live data associated with this CTA::Bus, if available.
9 10 11 |
# File 'lib/cta_redux/models/bus.rb', line 9 def live @live end |
Instance Method Details
#block_id ⇒ Integer
29 |
# File 'lib/cta_redux/models/bus.rb', line 29 alias_method :id, :route_id |
#direction ⇒ String
29 |
# File 'lib/cta_redux/models/bus.rb', line 29 alias_method :id, :route_id |
#direction_id ⇒ Integer
29 |
# File 'lib/cta_redux/models/bus.rb', line 29 alias_method :id, :route_id |
#predictions!(options = {}) ⇒ CTA::BusTracker::PredictionsResponse
Returns predictions for this CTA::Bus. Accepts all options for CTA::BusTracker.predictions!, and will merge in it’s own vehicle_id or route_id if present.
44 45 46 47 |
# File 'lib/cta_redux/models/bus.rb', line 44 def predictions!( = {}) opts = (self.vehicle_id ? { :vehicles => self.vehicle_id } : { :routes => self.route_id }) CTA::BusTracker.predictions!(.merge(opts)) end |
#route_id ⇒ String Also known as: id
29 |
# File 'lib/cta_redux/models/bus.rb', line 29 alias_method :id, :route_id |
#schd_trip_id ⇒ String Also known as: scheduled_trip_id, run
29 |
# File 'lib/cta_redux/models/bus.rb', line 29 alias_method :id, :route_id |
#service_id ⇒ Integer
29 |
# File 'lib/cta_redux/models/bus.rb', line 29 alias_method :id, :route_id |
#shape_id ⇒ Integer
29 |
# File 'lib/cta_redux/models/bus.rb', line 29 alias_method :id, :route_id |
#trip_id ⇒ Integer
29 |
# File 'lib/cta_redux/models/bus.rb', line 29 alias_method :id, :route_id |
#wheelchair_accessible ⇒ true, false
29 |
# File 'lib/cta_redux/models/bus.rb', line 29 alias_method :id, :route_id |