Module: Weese::Bus::RequiresStop
Overview
These requests require a Stop
Instance Method Summary collapse
-
#next_buses(stop) ⇒ Hash
Next bus arrivals at a given stop.
-
#stop_schedule(stop, date = nil) ⇒ Hash
Buses scheduled at a stop for an optional given date.
Methods included from Requests::Requester
Instance Method Details
#next_buses(stop) ⇒ Hash
Next bus arrivals at a given stop. WMATA Documentation
36 37 38 39 40 41 42 43 44 |
# File 'lib/weese/bus/stop.rb', line 36 def next_buses(stop) fetch( Requests::Request.new( @api_key, Bus::Urls::NEXT_BUSES, StopID: stop.id ) ) end |
#stop_schedule(stop, date = nil) ⇒ Hash
Buses scheduled at a stop for an optional given date. WMATA Documentation
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/weese/bus/stop.rb', line 57 def stop_schedule(stop, date = nil) query = { StopID: stop.id } query['Date'] = date.to_s if date fetch( Requests::Request.new( @api_key, Bus::Urls::STOP_SCHEDULE, query ) ) end |