Class: OnebusawaySDK::Resources::TripsForLocation

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ TripsForLocation

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

Parameters:



51
52
53
# File 'lib/onebusaway_sdk/resources/trips_for_location.rb', line 51

def initialize(client:)
  @client = client
end

Instance Method Details

#list(lat: , lat_span: , lon: , lon_span: , include_schedule: nil, include_trip: nil, time: nil, request_options: {}) ⇒ OnebusawaySDK::Models::TripsForLocationListResponse

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

Retrieve trips for a given location

Parameters:

  • lat (Float)

    The latitude coordinate of the search center

  • lat_span (Float)

    Latitude span of the search bounding box

  • lon (Float)

    The longitude coordinate of the search center

  • lon_span (Float)

    Longitude span of the search bounding box

  • include_schedule (Boolean)

    Whether to include full schedule elements in the tripDetails section. Defaults t

  • include_trip (Boolean)

    Whether to include full trip elements in the references section. Defaults to fal

  • time (Integer)

    Specific time for the query. Defaults to the current time.

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

Returns:

See Also:



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

def list(params)
  parsed, options = OnebusawaySDK::TripsForLocationListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "api/where/trips-for-location.json",
    query: parsed.transform_keys(
      lat_span: "latSpan",
      lon_span: "lonSpan",
      include_schedule: "includeSchedule",
      include_trip: "includeTrip"
    ),
    model: OnebusawaySDK::Models::TripsForLocationListResponse,
    options: options
  )
end