Class: Mercedes::Client
- Inherits:
-
Object
- Object
- Mercedes::Client
- Defined in:
- lib/mercedes/client.rb,
lib/mercedes/client/door.rb,
lib/mercedes/client/fuel.rb,
lib/mercedes/client/tire.rb,
lib/mercedes/client/charge.rb,
lib/mercedes/client/vehicle.rb,
lib/mercedes/client/location.rb,
lib/mercedes/client/odometer.rb
Defined Under Namespace
Modules: Charge, Door, Fuel, Location, Odometer, Tire, Vehicle
Constant Summary collapse
- CarNotAvailable =
Class.new(RuntimeError)
- NotFound =
Class.new(RuntimeError)
- ServerError =
Class.new(RuntimeError)
Class.new(RuntimeError)
- BASE_URL =
'https://api.mercedes-benz.com/experimental/connectedvehicle/v1/'- TIMEOUT =
10
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
Methods included from Vehicle
Methods included from Tire
Methods included from Odometer
Methods included from Location
Methods included from Fuel
Methods included from Door
#doors, #lock_doors, #unlock_doors
Methods included from Charge
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
31 32 33 34 35 36 37 |
# File 'lib/mercedes/client.rb', line 31 def initialize( = {}) Configurable::OPTIONS.each do |key| instance_variable_set(:"@#{key}", [key] || Mercedes.send(key)) end http_client.base_url = BASE_URL end |