arcgis_vrps 0.0.4.1 → 0.0.4.2
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/lib/arcgis_vrps.rb +4 -0
- data/lib/arcgis_vrps/auth.rb +1 -6
- 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: 41263f243a218033df0993e89a980c0867fd3884
|
4
|
+
data.tar.gz: 993c2d84399e09df5e28dccb8fd0f99c08642ff1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d374322bbd1ad3a793c14d6616698d4dca4daac1949a88718934f5f4c6f504d74165fa163d0a2fca32667d83b659d0f7e25d7d6a187b0478fe0fbb9ff5d16971
|
7
|
+
data.tar.gz: 2fc664f4ef3e9943271b4d4ba009a8214512b5ad78f1ffd62a6a76c49b9109d659422d42f5ca3bfef7d619ae8f30310aa0ad4bde48f9cf1c8c83dd0f95051fcb
|
data/lib/arcgis_vrps.rb
CHANGED
data/lib/arcgis_vrps/auth.rb
CHANGED
@@ -2,7 +2,6 @@ require 'json'
|
|
2
2
|
require 'net/http'
|
3
3
|
|
4
4
|
class Auth
|
5
|
-
@token = ""
|
6
5
|
def initialize(client_id, client_secret)
|
7
6
|
if client_id.nil? || client_id.empty? || client_secret.nil? || client_secret.empty?
|
8
7
|
raise ArgumentError, "Both Client ID & Client Secret has to be set"
|
@@ -34,7 +33,7 @@ class Auth
|
|
34
33
|
|
35
34
|
res = http.request(req)
|
36
35
|
|
37
|
-
|
36
|
+
token = JSON.parse(res.body)['access_token']
|
38
37
|
puts "\n"+res.body
|
39
38
|
return token
|
40
39
|
rescue => e
|
@@ -42,8 +41,4 @@ class Auth
|
|
42
41
|
puts e
|
43
42
|
end
|
44
43
|
end
|
45
|
-
|
46
|
-
def getToken
|
47
|
-
return @token
|
48
|
-
end
|
49
44
|
end
|