td-client 0.8.37 → 0.8.38
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.
- data/ChangeLog +5 -0
- data/lib/td/client.rb +2 -2
- data/lib/td/client/api.rb +2 -1
- data/lib/td/client/model.rb +6 -1
- data/lib/td/client/version.rb +1 -1
- metadata +2 -2
data/ChangeLog
CHANGED
data/lib/td/client.rb
CHANGED
@@ -43,8 +43,8 @@ class Client
|
|
43
43
|
|
44
44
|
# => Account
|
45
45
|
def account
|
46
|
-
account_id, plan, storage, guaranteed_cores, maximum_cores = @api.show_account
|
47
|
-
return Account.new(self, account_id, plan, storage, guaranteed_cores, maximum_cores)
|
46
|
+
account_id, plan, storage, guaranteed_cores, maximum_cores, created_at = @api.show_account
|
47
|
+
return Account.new(self, account_id, plan, storage, guaranteed_cores, maximum_cores, created_at)
|
48
48
|
end
|
49
49
|
|
50
50
|
def core_utilization(from, to)
|
data/lib/td/client/api.rb
CHANGED
@@ -162,7 +162,8 @@ class API
|
|
162
162
|
storage_size = a['storage_size'].to_i
|
163
163
|
guaranteed_cores = a['guaranteed_cores'].to_i
|
164
164
|
maximum_cores = a['maximum_cores'].to_i
|
165
|
-
|
165
|
+
created_at = a['created_at']
|
166
|
+
return [account_id, plan, storage_size, guaranteed_cores, maximum_cores, created_at]
|
166
167
|
end
|
167
168
|
|
168
169
|
def account_core_utilization(from, to)
|
data/lib/td/client/model.rb
CHANGED
@@ -11,17 +11,22 @@ class Model
|
|
11
11
|
end
|
12
12
|
|
13
13
|
class Account < Model
|
14
|
-
def initialize(client, account_id, plan, storage_size=nil, guaranteed_cores=nil, maximum_cores=nil)
|
14
|
+
def initialize(client, account_id, plan, storage_size=nil, guaranteed_cores=nil, maximum_cores=nil, created_at=nil)
|
15
15
|
super(client)
|
16
16
|
@account_id = account_id
|
17
17
|
@plan = plan
|
18
18
|
@storage_size = storage_size
|
19
19
|
@guaranteed_cores = guaranteed_cores
|
20
20
|
@maximum_cores = maximum_cores
|
21
|
+
@created_at = created_at
|
21
22
|
end
|
22
23
|
|
23
24
|
attr_reader :account_id, :plan, :storage_size, :guaranteed_cores, :maximum_cores
|
24
25
|
|
26
|
+
def created_at
|
27
|
+
@created_at && !@created_at.empty? ? Time.parse(@created_at) : nil
|
28
|
+
end
|
29
|
+
|
25
30
|
def storage_size_string
|
26
31
|
if @storage_size <= 1024*1024
|
27
32
|
return "0.0 GB"
|
data/lib/td/client/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: td-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.38
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: msgpack
|