smartcar 2.1.0 → 3.0.0

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,26 +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, :token
9
-
10
- def initialize(token:)
11
- raise InvalidParameterValue.new, "Access Token(token) is a required field" if token.nil?
12
- @token = token
13
- end
14
-
15
- # Class method Used to get user id
16
- # EX : Smartcar::User.fetch
17
- # API - https://smartcar.com/docs/api#get-user
18
- # @param token [String] Access token
19
- #
20
- # @return [User] object
21
- def self.user_id(token:)
22
- new(token: token).get(USER_PATH)['id']
23
- end
24
-
25
- end
26
- 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