Class: OnebusawaySDK::Resources::ScheduleForRoute

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ScheduleForRoute

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 ScheduleForRoute.

Parameters:



36
37
38
# File 'lib/onebusaway_sdk/resources/schedule_for_route.rb', line 36

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(route_id, date: nil, request_options: {}) ⇒ OnebusawaySDK::Models::ScheduleForRouteRetrieveResponse

Some parameter documentations has been truncated, see Models::ScheduleForRouteRetrieveParams for more details.

Retrieve the full schedule for a route on a particular day

Parameters:

  • route_id (String)

    The route id to request the schedule for

  • date (Date)

    The date for which you want to request a schedule in the format YYYY-MM-DD (opti

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

Returns:

See Also:



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

def retrieve(route_id, params = {})
  parsed, options = OnebusawaySDK::ScheduleForRouteRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["api/where/schedule-for-route/%1$s.json", route_id],
    query: parsed,
    model: OnebusawaySDK::Models::ScheduleForRouteRetrieveResponse,
    options: options
  )
end