Querying the Edinburgh bus arrival times using the bus_tracker gem

require 'bus_tracker'

service = BusTracker.service('44')
(service.public_methods - Object.public_methods).sort

#=> [:bus_stops, :bus_stops=, :fetch_bus_stops!, :number, :number=] 

service.number #=> "44" 

service.bus_stops.map(&:name)
#=>  ["[PL] S St David", "[YH] York Place", "[YJ] York Place", ...

bus_stop = service.bus_stops.first

#=> #<BusTracker::BusStop:0x9aacaa4 @service_numbers=["26", "44", "44A", "MA1"], @departures=[], @code="36232496", @name="[PL] S St David", @latitude="55.9530487060547", @longitude="-3.19380307197571"> 

a = service.bus_stops
(a[0].public_methods - Object.public_methods).sort
#=> [:code, :code=, :departures, :departures=, :fetch_departures!, :latitude, :latitude=, :longitude, :longitude=, :name=, :service_numbers, :service_numbers=] 

a[0].name #=> "[PL] S St David" 

a[0].fetch_departures!
a2 = a[0].departures

#=> [#<BusTracker::Departure:0x916f4a0 @service_number="26", @destination="TRANENT", @due="15">, #<BusTracker::Departure:0x916f324 @service_number="26", @destination="SETON SANDS", @due="27">, #<BusTracker::Departure:0x916f1d0 @service_number="26", @destination="TRANENT", @due="42">, #<...


## Resources