Class: TflApi::Client::AccidentStats
- Inherits:
-
Object
- Object
- TflApi::Client::AccidentStats
- Defined in:
- lib/tfl_api_client/accident_stats.rb
Overview
This class communicates with the TFL “/AccidentStats” API to obtain details about Accident Statistics based upon the year the accident occurred.
Instance Method Summary collapse
-
#details(year) ⇒ Array
Returns all accident details for accidents occurring in the specified year.
-
#initialize(client) ⇒ AccidentStats
constructor
Initialize the AccidentStats object and store the reference to Client object.
Constructor Details
#initialize(client) ⇒ AccidentStats
Initialize the AccidentStats object and store the reference to Client object.
41 42 43 |
# File 'lib/tfl_api_client/accident_stats.rb', line 41 def initialize(client) @client = client end |
Instance Method Details
#details(year) ⇒ Array
Returns all accident details for accidents occurring in the specified year.
50 51 52 |
# File 'lib/tfl_api_client/accident_stats.rb', line 50 def details(year) @client.get("/AccidentStats/#{year}") end |