myjohndeere 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/myjohndeere.rb +1 -1
- data/lib/myjohndeere/access_token.rb +4 -3
- data/lib/myjohndeere/util.rb +1 -1
- data/lib/myjohndeere/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57a8f1036dd4fa52f819321aeb68a4cd568e3ce5
|
4
|
+
data.tar.gz: 6e93bbc89e82f737f583d4c7c271c4585065cffa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6435df5d90336a07773b90541fc72a0622c6570e6bcf172726bb6b68f511bba13ea42bc5f5670f75a564e1f04c7727804a9528c1a16203862afa7afb2fdbb580
|
7
|
+
data.tar.gz: c2a3be9fbe3f567d78f239d7fa45e1443bcd2b7dc609c0190c1f9c868224bfd3ca85f8b607a79cd768f446af110ef275c46d35c54ff0951c8aaba989dab4c081
|
data/Gemfile.lock
CHANGED
data/lib/myjohndeere.rb
CHANGED
@@ -61,7 +61,7 @@ module MyJohnDeere
|
|
61
61
|
JSON_CONTENT_HEADER_VALUE = 'application/vnd.deere.axiom.v3+json'
|
62
62
|
ENDPOINTS = {
|
63
63
|
sandbox: "https://sandboxapi.deere.com/platform",
|
64
|
-
production: "https://
|
64
|
+
production: "https://api.soa-proxy.deere.com/platform"
|
65
65
|
}.freeze
|
66
66
|
AUTHORIZE_URL = "https://my.deere.com/consentToUseOfData"
|
67
67
|
DEFAULT_REQUEST_HEADER = { 'accept'=> JSON_CONTENT_HEADER_VALUE }.freeze
|
@@ -26,18 +26,19 @@ module MyJohnDeere
|
|
26
26
|
def initialize(options = {})
|
27
27
|
request_token_options = [:request_token_token, :request_token_secret, :verifier_code]
|
28
28
|
oauth_token_options = [:oauth_access_token_token, :oauth_access_token_secret]
|
29
|
+
oauth_consumer = self.class.oauth_consumer(debug_output: options[:debug_output])
|
29
30
|
if request_token_options.all? { |i| options.key?(i) } then
|
30
|
-
request_token = OAuth::RequestToken.from_hash(
|
31
|
+
request_token = OAuth::RequestToken.from_hash(oauth_consumer, {
|
31
32
|
oauth_token: options[:request_token_token],
|
32
33
|
oauth_token_secret: options[:request_token_secret]
|
33
34
|
})
|
34
35
|
self.oauth_access_token = request_token.get_access_token(oauth_verifier: options[:verifier_code])
|
35
36
|
elsif oauth_token_options.all? { |i| options.key?(i) } then
|
36
37
|
self.oauth_access_token = OAuth::AccessToken.from_hash(
|
37
|
-
|
38
|
+
oauth_consumer,
|
38
39
|
{
|
39
40
|
oauth_token: options[:oauth_access_token_token],
|
40
|
-
oauth_token_secret: options[:oauth_access_token_secret]
|
41
|
+
oauth_token_secret: options[:oauth_access_token_secret],
|
41
42
|
}
|
42
43
|
)
|
43
44
|
else
|
data/lib/myjohndeere/util.rb
CHANGED
data/lib/myjohndeere/version.rb
CHANGED