Module: Aucklandia::Routes
- Included in:
- Client
- Defined in:
- lib/aucklandia/routes.rb
Constant Summary collapse
- ROUTE_ENDPOINT =
'/gtfs/routes'
Instance Method Summary collapse
- #get_route_by_id(route_id) ⇒ Object
- #get_routes ⇒ Object
- #get_routes_by_short_name(short_name) ⇒ Object
Instance Method Details
#get_route_by_id(route_id) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/aucklandia/routes.rb', line 21 def get_route_by_id(route_id) url = build_url(BASE_URL, ROUTE_ENDPOINT, '/routeId/', route_id) response = get(url) JSON.parse(response)['response'].first end |
#get_routes ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/aucklandia/routes.rb', line 5 def get_routes url = build_url(BASE_URL, ROUTE_ENDPOINT) response = get(url) JSON.parse(response)['response'] end |
#get_routes_by_short_name(short_name) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/aucklandia/routes.rb', line 13 def get_routes_by_short_name(short_name) url = build_url(BASE_URL, ROUTE_ENDPOINT, '/routeShortName/', short_name) response = get(url) JSON.parse(response)['response'] end |