Class: OnebusawaySDK::Resources::RoutesForLocation

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ RoutesForLocation

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

Parameters:



35
36
37
# File 'lib/onebusaway_sdk/resources/routes_for_location.rb', line 35

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::RoutesForLocationListResponse

routes-for-location

Parameters:

  • lat (Float)
  • lon (Float)
  • lat_span (Float)
  • lon_span (Float)
  • query (String)
  • radius (Float)
  • request_options (OnebusawaySDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



21
22
23
24
25
26
27
28
29
30
# File 'lib/onebusaway_sdk/resources/routes_for_location.rb', line 21

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