Class: Openf1::Client
- Inherits:
-
Object
- Object
- Openf1::Client
- Defined in:
- lib/openf1/client.rb
Constant Summary collapse
- BASE_URL =
"https://api.openf1.org/v1"
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
Instance Method Summary collapse
- #car_data(params = {}) ⇒ Object
- #drivers(params = {}) ⇒ Object
-
#initialize(api_key: nil) ⇒ Client
constructor
A new instance of Client.
- #intervals(params = {}) ⇒ Object
- #laps(params = {}) ⇒ Object
- #location(params = {}) ⇒ Object
- #meetings(params = {}) ⇒ Object
- #pit(params = {}) ⇒ Object
- #position(params = {}) ⇒ Object
- #race_control(params = {}) ⇒ Object
- #sessions(params = {}) ⇒ Object
- #stints(params = {}) ⇒ Object
- #team_radio(params = {}) ⇒ Object
- #weather(params = {}) ⇒ Object
Constructor Details
#initialize(api_key: nil) ⇒ Client
Returns a new instance of Client.
11 12 13 |
# File 'lib/openf1/client.rb', line 11 def initialize(api_key: nil) @api_key = api_key end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
7 8 9 |
# File 'lib/openf1/client.rb', line 7 def api_key @api_key end |
Instance Method Details
#car_data(params = {}) ⇒ Object
15 16 17 |
# File 'lib/openf1/client.rb', line 15 def car_data(params = {}) CarData.new(get_request("car_data", params)) end |
#drivers(params = {}) ⇒ Object
19 20 21 |
# File 'lib/openf1/client.rb', line 19 def drivers(params = {}) Drivers.new(get_request("drivers", params)) end |
#intervals(params = {}) ⇒ Object
23 24 25 |
# File 'lib/openf1/client.rb', line 23 def intervals(params = {}) Intervals.new(get_request("intervals", params)) end |
#laps(params = {}) ⇒ Object
27 28 29 |
# File 'lib/openf1/client.rb', line 27 def laps(params = {}) Laps.new(get_request("laps", params)) end |
#location(params = {}) ⇒ Object
31 32 33 |
# File 'lib/openf1/client.rb', line 31 def location(params = {}) Location.new(get_request("location", params)) end |
#meetings(params = {}) ⇒ Object
35 36 37 |
# File 'lib/openf1/client.rb', line 35 def meetings(params = {}) Meetings.new(get_request("meetings", params)) end |
#pit(params = {}) ⇒ Object
39 40 41 |
# File 'lib/openf1/client.rb', line 39 def pit(params = {}) Pit.new(get_request("pit", params)) end |
#position(params = {}) ⇒ Object
43 44 45 |
# File 'lib/openf1/client.rb', line 43 def position(params = {}) Position.new(get_request("position", params)) end |
#race_control(params = {}) ⇒ Object
47 48 49 |
# File 'lib/openf1/client.rb', line 47 def race_control(params = {}) RaceControl.new(get_request("race_control", params)) end |
#sessions(params = {}) ⇒ Object
51 52 53 |
# File 'lib/openf1/client.rb', line 51 def sessions(params = {}) Sessions.new(get_request("sessions", params)) end |
#stints(params = {}) ⇒ Object
55 56 57 |
# File 'lib/openf1/client.rb', line 55 def stints(params = {}) Stints.new(get_request("stints", params)) end |