Class: OnebusawaySDK::Resources::StopsForRoute

Inherits:
Object
  • Object
show all
Defined in:
lib/onebusaway_sdk/resources/stops_for_route.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ StopsForRoute

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of StopsForRoute.

Parameters:



35
36
37
# File 'lib/onebusaway_sdk/resources/stops_for_route.rb', line 35

def initialize(client:)
  @client = client
end

Instance Method Details

#list(route_id, include_polylines: nil, time: nil, request_options: {}) ⇒ OnebusawaySDK::Models::StopsForRouteListResponse

Get stops for a specific route

Parameters:

  • route_id (String)

    ID of the route

  • include_polylines (Boolean)

    Include polyline elements in the response (default true)

  • time (String)

    Specify service date (YYYY-MM-DD or epoch) (default today)

  • request_options (OnebusawaySDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



21
22
23
24
25
26
27
28
29
30
# File 'lib/onebusaway_sdk/resources/stops_for_route.rb', line 21

def list(route_id, params = {})
  parsed, options = OnebusawaySDK::StopsForRouteListParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["api/where/stops-for-route/%1$s.json", route_id],
    query: parsed.transform_keys(include_polylines: "includePolylines"),
    model: OnebusawaySDK::Models::StopsForRouteListResponse,
    options: options
  )
end