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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d2b8ce6cb345af4e249a0d19721d158e7f7c2c1
4
- data.tar.gz: 36355c6fa6547f9df84977abe8d094339ed46ef1
3
+ metadata.gz: d19f6ac030464c15558af332b1ec1a3753486713
4
+ data.tar.gz: f5b3d64e72efe3d261ab96f72ec8b4be51667e2a
5
5
  SHA512:
6
- metadata.gz: 3a7dcd20c2c8c11e451f9832d0d7553795ba31e81682a09f8d95318dcabf2ef95fa9cc60164c69ebd5441371c80772286dec89b4e63d7280d16daae3fe15024a
7
- data.tar.gz: 2adf4b6a9130eeee8b301f8710261712fc402481d48b222bb7d8d712408498ea540667e1fd5363c8d7bcc276615772ea423dc2a4d63282a4e2afce77bcf30009
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
- @api_token = options[:api_token] || ''
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
@@ -10,7 +10,7 @@ module Testcloud
10
10
  MAJOR = 0
11
11
  MINOR = 0
12
12
  PATCH = 0
13
- PRE = 1
13
+ PRE = 2
14
14
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
15
15
  end
16
16
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testcloud_devices_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0.1
4
+ version: 0.0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Faucett