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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b57225d3763fbbe7c577b89697ea80af48c4de44dcb39efdbb3a4811bfcfc27d
4
- data.tar.gz: 5b7915fd5b5686909ddc01a63725287ed1771efa53b48b4c5c7327a6079449e1
3
+ metadata.gz: 42d14a5db8893d4b26b07e273924b854c1c5970aee1a072e5d748a95a5934201
4
+ data.tar.gz: 8b5c2a8c57127a1a494dc6448c84a251d8c6f2eaf0f6773255258006dcac7296
5
5
  SHA512:
6
- metadata.gz: f792bda809f5a3be1e89f775877f3ce11495b2416c8ec3d0767e8e0ed744333203a0defeb95beca33ba6f0f42d93bcaf7fd40cd6e6dc86ebcdf5fbb066487efa
7
- data.tar.gz: cd9e6ac196300057dc0e704aab9a75bb65c0475273cf60b62872c92a07d7d7975f316e5e7c7bdab3424c866af1eac710492db538cd94b29e72dfd3678fcad73f
6
+ metadata.gz: 3b143db051f1009607453d86e2f034b3ad3a6a32949a0aee77ea88a6ef4db34e9d0f65d2b3e8da361eb4aee7da4cad4bcfe873aeb8079647287d488206f6fddb
7
+ data.tar.gz: 47061d5c08c3db932e6d8c0b2cea7e0064c60348122ac70fb537fbf512b19b545593d9448cbc91766299c8c31ae79029088d10dab56fc5a445d47de501d635ef
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smartcar (2.0.0)
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.1.0)
13
+ faraday (1.2.0)
14
14
  multipart-post (>= 1.2, < 3)
15
15
  ruby2_keywords
16
16
  jwt (2.2.2)
@@ -4,6 +4,7 @@ require "smartcar/base"
4
4
  require "smartcar/oauth"
5
5
  require "smartcar/permissions"
6
6
  require "smartcar/battery"
7
+ require "smartcar/battery_capacity"
7
8
  require "smartcar/charge"
8
9
  require "smartcar/engine_oil"
9
10
  require "smartcar/fuel"
@@ -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
@@ -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
  #
@@ -1,4 +1,4 @@
1
1
  module Smartcar
2
2
  # Gem current version number
3
- VERSION = "2.0.0"
3
+ VERSION = "2.1.0"
4
4
  end
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.0.0
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-04 00:00:00.000000000 Z
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