Class: OnebusawaySDK::Resources::SearchForStop

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ SearchForStop

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

Parameters:



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

def initialize(client:)
  @client = client
end

Instance Method Details

#list(input: , max_count: nil, request_options: {}) ⇒ OnebusawaySDK::Models::SearchForStopListResponse

Search for a stop based on its name.

Parameters:

  • input (String)

    The string to search for.

  • max_count (Integer)

    The max number of results to return. Defaults to 20.

  • 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/search_for_stop.rb', line 19

def list(params)
  parsed, options = OnebusawaySDK::SearchForStopListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "api/where/search/stop.json",
    query: parsed.transform_keys(max_count: "maxCount"),
    model: OnebusawaySDK::Models::SearchForStopListResponse,
    options: options
  )
end