Module: RubyPtv::Stops
- Included in:
- Client
- Defined in:
- lib/ruby_ptv/client/stops.rb
Instance Method Summary collapse
-
#stop(stop_id, route_type, options = {}) ⇒ Object
Stop location, amenity and accessibility facility information for the specified stop.
-
#stops_for_location(latitude, longitude, options = {}) ⇒ Object
All stops for the specified location.
-
#stops_for_route(route_id, route_type) ⇒ Object
All stops for the specified route.
Instance Method Details
#stop(stop_id, route_type, options = {}) ⇒ Object
Stop location, amenity and accessibility facility information for the specified stop
Required params:
stop_id [Integer]
route_type [Integer]
Optional params must have key matching official PTV param name
10 11 12 13 |
# File 'lib/ruby_ptv/client/stops.rb', line 10 def stop(stop_id, route_type, = {}) data = request("stops/#{stop_id}/route_type/#{route_type}", ) data["stop"] end |
#stops_for_location(latitude, longitude, options = {}) ⇒ Object
All stops for the specified location
Required params:
latitude [Float]
longitude [Float]
Optional params must have key matching official PTV param name
34 35 36 37 |
# File 'lib/ruby_ptv/client/stops.rb', line 34 def stops_for_location(latitude, longitude, = {}) data = request("stops/location/#{latitude},#{longitude}", ) data["stops"] end |
#stops_for_route(route_id, route_type) ⇒ Object
All stops for the specified route
Required params:
route_id [Integer]
route_type [Integer]
No optional params available
22 23 24 25 |
# File 'lib/ruby_ptv/client/stops.rb', line 22 def stops_for_route(route_id, route_type) data = request("stops/route/#{route_id}/route_type/#{route_type}") data["stops"] end |