Class: OnebusawaySDK::Resources::VehiclesForAgency

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ VehiclesForAgency

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

Parameters:



33
34
35
# File 'lib/onebusaway_sdk/resources/vehicles_for_agency.rb', line 33

def initialize(client:)
  @client = client
end

Instance Method Details

#list(agency_id, time: nil, request_options: {}) ⇒ OnebusawaySDK::Models::VehiclesForAgencyListResponse

Get vehicles for a specific agency

Parameters:

  • agency_id (String)

    ID of the agency

  • time (String)

    Specific time for querying the status (timestamp format)

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

Returns:

See Also:



19
20
21
22
23
24
25
26
27
28
# File 'lib/onebusaway_sdk/resources/vehicles_for_agency.rb', line 19

def list(agency_id, params = {})
  parsed, options = OnebusawaySDK::VehiclesForAgencyListParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["api/where/vehicles-for-agency/%1$s.json", agency_id],
    query: parsed,
    model: OnebusawaySDK::Models::VehiclesForAgencyListResponse,
    options: options
  )
end