smartcar 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/smartcar.rb +1 -0
- data/lib/smartcar/battery_capacity.rb +9 -0
- data/lib/smartcar/vehicle.rb +9 -0
- data/lib/smartcar/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42d14a5db8893d4b26b07e273924b854c1c5970aee1a072e5d748a95a5934201
|
4
|
+
data.tar.gz: 8b5c2a8c57127a1a494dc6448c84a251d8c6f2eaf0f6773255258006dcac7296
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b143db051f1009607453d86e2f034b3ad3a6a32949a0aee77ea88a6ef4db34e9d0f65d2b3e8da361eb4aee7da4cad4bcfe873aeb8079647287d488206f6fddb
|
7
|
+
data.tar.gz: 47061d5c08c3db932e6d8c0b2cea7e0064c60348122ac70fb537fbf512b19b545593d9448cbc91766299c8c31ae79029088d10dab56fc5a445d47de501d635ef
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
smartcar (2.
|
4
|
+
smartcar (2.1.0)
|
5
5
|
oauth2 (~> 1.4)
|
6
6
|
|
7
7
|
GEM
|
@@ -10,7 +10,7 @@ GEM
|
|
10
10
|
byebug (11.1.3)
|
11
11
|
childprocess (3.0.0)
|
12
12
|
diff-lcs (1.3)
|
13
|
-
faraday (1.
|
13
|
+
faraday (1.2.0)
|
14
14
|
multipart-post (>= 1.2, < 3)
|
15
15
|
ruby2_keywords
|
16
16
|
jwt (2.2.2)
|
data/lib/smartcar.rb
CHANGED
@@ -0,0 +1,9 @@
|
|
1
|
+
module Smartcar
|
2
|
+
# class to represent Battery Capacity info
|
3
|
+
#@attr [Number] capacity Decimal value representing the battery's total capacity in kWh.
|
4
|
+
class BatteryCapacity < Base
|
5
|
+
# Path Proc for hitting battery capacity end point
|
6
|
+
PATH = Proc.new{|id| "/vehicles/#{id}/battery/capacity"}
|
7
|
+
attr_reader :capacity
|
8
|
+
end
|
9
|
+
end
|
data/lib/smartcar/vehicle.rb
CHANGED
@@ -147,6 +147,15 @@ module Smartcar
|
|
147
147
|
get_attribute(Battery)
|
148
148
|
end
|
149
149
|
|
150
|
+
# Returns the capacity of an electric or
|
151
|
+
# plug-in hybrid vehicle's battery.
|
152
|
+
# API - https://smartcar.com/docs/api#get-ev-battery-capacity
|
153
|
+
#
|
154
|
+
# @return [Battery] object
|
155
|
+
def battery_capacity
|
156
|
+
get_attribute(BatteryCapacity)
|
157
|
+
end
|
158
|
+
|
150
159
|
# Returns the current charge status of the vehicle.
|
151
160
|
# API - https://smartcar.com/docs/api#get-ev-battery
|
152
161
|
#
|
data/lib/smartcar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smartcar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ashwin Subramanian
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- lib/smartcar.rb
|
138
138
|
- lib/smartcar/base.rb
|
139
139
|
- lib/smartcar/battery.rb
|
140
|
+
- lib/smartcar/battery_capacity.rb
|
140
141
|
- lib/smartcar/charge.rb
|
141
142
|
- lib/smartcar/engine_oil.rb
|
142
143
|
- lib/smartcar/fuel.rb
|