smartcar 2.4.0 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +0,0 @@
1
- module Smartcar
2
- # class to represent Odometer
3
- #@attr [Number] distanceLast recorded odometer reading.
4
- class Odometer < Base
5
- # Path Proc for hitting odometer end point
6
- PATH = Proc.new{|id| "/vehicles/#{id}/odometer"}
7
- attr_reader :distance
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Smartcar
2
- # class to represent permissions response
3
- #@attr [Array] permissions Array of permissions granted on the vehicle.
4
- class Permissions < Base
5
- # Path Proc for hitting permissions end point
6
- PATH = Proc.new{|id| "/vehicles/#{id}/permissions"}
7
- attr_reader :permissions
8
- end
9
- end
@@ -1,19 +0,0 @@
1
- module Smartcar
2
- # class to represent Tire Pressure response
3
- #@attr [Number] back_left Last recorded tire pressure of the back left tire.
4
- #@attr [Number] back_right Last recorded tire pressure of the back right tire.
5
- #@attr [Number] front_left Last recorded tire pressure of the front left tire.
6
- #@attr [Number] front_right Last recorded tire pressure of the front right tire.
7
-
8
- class TirePressure < Base
9
- # Path Proc for hitting tire pressure end point
10
- PATH = Proc.new{|id| "/vehicles/#{id}/tires/pressure"}
11
- attr_reader :backLeft, :backRight, :frontLeft, :frontRight
12
-
13
- # just to have Ruby-esque method names
14
- alias_method :back_left, :backLeft
15
- alias_method :back_right, :backRight
16
- alias_method :front_left, :frontLeft
17
- alias_method :front_right, :frontRight
18
- end
19
- end
data/lib/smartcar/user.rb DELETED
@@ -1,35 +0,0 @@
1
- module Smartcar
2
- # Class to get to user API.
3
- #@attr [String] id Smartcar user id.
4
- #@attr [String] token Access token used to connect to Smartcar API.
5
- class User < Base
6
- # Path for hitting user end point
7
- USER_PATH = '/user'.freeze
8
- attr_reader :id
9
-
10
- # Class method Used to get user id
11
- # EX : Smartcar::User.user_id
12
- # API - https://smartcar.com/docs/api#get-user
13
- # @param token [String] Access token
14
- #
15
- # @return [String] User ID
16
- def self.user_id(token:, version: Smartcar.get_api_version)
17
- # @deprecated Please use {#get} instead
18
- warn "[DEPRECATION] `Smartcar::User.user_id` is deprecated and will be removed in next major version update. Please use `Smartcar::User.get` instead."
19
- get(token: token, version: version).id
20
- end
21
-
22
- # Class method Used to get user id
23
- # EX : Smartcar::User.get
24
- # API - https://smartcar.com/docs/api#get-user
25
- # @param token [String] Access token
26
- #
27
- # @return [User] User object
28
- def self.get(token:, version: Smartcar.get_api_version)
29
- user = new(token: token, version: version)
30
- body, _meta = user.fetch(path: USER_PATH)
31
- user.instance_variable_set('@id', body['id'])
32
- user
33
- end
34
- end
35
- end
@@ -1,12 +0,0 @@
1
- module Smartcar
2
- # class to represent Vehicle attributes like make model year
3
- #@attr [String] id Smartcar vehicle ID
4
- #@attr [String] make Manufacturer of the vehicle.
5
- #@attr [String] model Model of the vehicle.
6
- #@attr [Number] year Model year of the vehicle.
7
- class VehicleAttributes < Base
8
- # Path Proc for hitting vehicle attributes end point
9
- PATH = Proc.new{|id| "/vehicles/#{id}"}
10
- attr_accessor :id, :make, :model, :year
11
- end
12
- end
data/lib/smartcar/vin.rb DELETED
@@ -1,10 +0,0 @@
1
- module Smartcar
2
- # Hidden class to represent vin
3
- #
4
- #@attr [String] vin Vin of the vehicle
5
- class Vin < Base
6
- # Path Proc for hitting vin end point
7
- PATH = Proc.new{|id| "/vehicles/#{id}/vin"}
8
- attr_reader :vin
9
- end
10
- end