Class: OnebusawaySDK::Resources::ScheduleForStop

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ScheduleForStop

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

Parameters:



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

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(stop_id, date: nil, request_options: {}) ⇒ OnebusawaySDK::Models::ScheduleForStopRetrieveResponse

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

Get schedule for a specific stop

Parameters:

  • stop_id (String)

    The stop id to request the schedule for, encoded directly in the URL

  • 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_stop.rb', line 22

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