Class: OnebusawaySDK::Resources::StopsForLocation

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ StopsForLocation

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

Parameters:



41
42
43
# File 'lib/onebusaway_sdk/resources/stops_for_location.rb', line 41

def initialize(client:)
  @client = client
end

Instance Method Details

#list(lat: , lon: , lat_span: nil, lon_span: nil, query: nil, radius: nil, request_options: {}) ⇒ OnebusawaySDK::Models::StopsForLocationListResponse

stops-for-location

Parameters:

  • lat (Float)
  • lon (Float)
  • lat_span (Float)

    An alternative to radius to set the search bounding box (optional)

  • lon_span (Float)

    An alternative to radius to set the search bounding box (optional)

  • query (String)

    A search query string to filter the results

  • radius (Float)

    The radius in meters to search within

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

Returns:

See Also:



27
28
29
30
31
32
33
34
35
36
# File 'lib/onebusaway_sdk/resources/stops_for_location.rb', line 27

def list(params)
  parsed, options = OnebusawaySDK::StopsForLocationListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "api/where/stops-for-location.json",
    query: parsed.transform_keys(lat_span: "latSpan", lon_span: "lonSpan"),
    model: OnebusawaySDK::Models::StopsForLocationListResponse,
    options: options
  )
end