testcloud_devices_ruby 0.0.0.1 → 0.0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/testcloud/devices/client.rb +16 -2
- data/lib/testcloud/devices/ruby/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: d19f6ac030464c15558af332b1ec1a3753486713
|
4
|
+
data.tar.gz: f5b3d64e72efe3d261ab96f72ec8b4be51667e2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88a2327bc73b9a23242225303bdd679beb207b92ee7b84a60c6d8d44cdd091fb5fcf84f9ec8becabe2ab4daa415a2ffc4001facf7c59f0b4cb0a4f27c6a3595d
|
7
|
+
data.tar.gz: 0c22d66d225f66fd4c0605d150377944a8531764320027a12800b7b0e51f5f04c1acece11d8c62199db19b6d568d7ce6fb6aaddbd98f2af9cf67f6d20cf3f207
|
@@ -7,11 +7,25 @@ module Testcloud
|
|
7
7
|
|
8
8
|
attr_accessor :type, :category, :api_token
|
9
9
|
|
10
|
+
class << self
|
11
|
+
def setup(&block)
|
12
|
+
yield(self)
|
13
|
+
end
|
14
|
+
|
15
|
+
def api_token=(value)
|
16
|
+
@api_token = value
|
17
|
+
end
|
18
|
+
|
19
|
+
def api_token
|
20
|
+
@api_token
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
10
24
|
def initialize(options = {})
|
11
25
|
@type, @category = options[:type], options[:category]
|
12
26
|
self.class.debug_output if options[:debug]
|
13
27
|
self.class.base_uri(options[:url] || DEFAULT_URL)
|
14
|
-
|
28
|
+
self.class.api_token = options[:api_token] if options[:api_token]
|
15
29
|
end
|
16
30
|
|
17
31
|
def types
|
@@ -36,7 +50,7 @@ module Testcloud
|
|
36
50
|
|
37
51
|
private
|
38
52
|
def access_headers
|
39
|
-
@access_headers ||= { headers: { API_TOKEN_KEY => api_token } }
|
53
|
+
@access_headers ||= { headers: { API_TOKEN_KEY => self.class.api_token } }
|
40
54
|
end
|
41
55
|
|
42
56
|
end
|