Class: OnebusawaySDK::Resources::TripDetails

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ TripDetails

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

Parameters:



49
50
51
# File 'lib/onebusaway_sdk/resources/trip_details.rb', line 49

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(trip_id, include_schedule: nil, include_status: nil, include_trip: nil, service_date: nil, time: nil, request_options: {}) ⇒ OnebusawaySDK::Models::TripDetailRetrieveResponse

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

Retrieve Trip Details

Parameters:

  • trip_id (String)

    ID of the trip to retrieve details for.

  • include_schedule (Boolean)

    Whether to include the full schedule element in the tripDetails section (default

  • include_status (Boolean)

    Whether to include the full status element in the tripDetails section (defaults

  • include_trip (Boolean)

    Whether to include the full trip element in the references section (defaults to

  • service_date (Integer)

    Service date for the trip as Unix time in milliseconds (optional).

  • time (Integer)

    Time parameter to query the system at a specific time (optional).

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

Returns:

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/onebusaway_sdk/resources/trip_details.rb', line 30

def retrieve(trip_id, params = {})
  parsed, options = OnebusawaySDK::TripDetailRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["api/where/trip-details/%1$s.json", trip_id],
    query: parsed.transform_keys(
      include_schedule: "includeSchedule",
      include_status: "includeStatus",
      include_trip: "includeTrip",
      service_date: "serviceDate"
    ),
    model: OnebusawaySDK::Models::TripDetailRetrieveResponse,
    options: options
  )
end