Class: OnebusawaySDK::Resources::ReportProblemWithStop

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ReportProblemWithStop

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

Parameters:



46
47
48
# File 'lib/onebusaway_sdk/resources/report_problem_with_stop.rb', line 46

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(stop_id, code: nil, user_comment: nil, user_lat: nil, user_location_accuracy: nil, user_lon: nil, request_options: {}) ⇒ OnebusawaySDK::Models::ResponseWrapper

Submit a user-generated problem report for a stop

Parameters:

  • stop_id (String)

    The ID of the stop

  • code (Symbol, OnebusawaySDK::Models::ReportProblemWithStopRetrieveParams::Code)

    A string code identifying the nature of the problem

  • user_comment (String)

    Additional comment text supplied by the user describing the problem

  • user_lat (Float)

    The reporting user’s current latitude

  • user_location_accuracy (Float)

    The reporting user’s location accuracy, in meters

  • user_lon (Float)

    The reporting user’s current longitude

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

Returns:

See Also:



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/onebusaway_sdk/resources/report_problem_with_stop.rb', line 27

def retrieve(stop_id, params = {})
  parsed, options = OnebusawaySDK::ReportProblemWithStopRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["api/where/report-problem-with-stop/%1$s.json", stop_id],
    query: parsed.transform_keys(
      user_comment: "userComment",
      user_lat: "userLat",
      user_location_accuracy: "userLocationAccuracy",
      user_lon: "userLon"
    ),
    model: OnebusawaySDK::ResponseWrapper,
    options: options
  )
end