td-client 0.8.34 → 0.8.35

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 CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ == 2012-10-23 version 0.8.35
3
+
4
+ * Added Account#account_id
5
+
6
+
2
7
  == 2012-10-16 version 0.8.34
3
8
 
4
9
  * Set Net::HTTP#open_timeout = 60
@@ -43,8 +43,8 @@ class Client
43
43
 
44
44
  # => Account
45
45
  def account
46
- plan, storage, guaranteed_cores, maximum_cores = @api.show_account
47
- return Account.new(self, plan, storage, guaranteed_cores, maximum_cores)
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)
48
48
  end
49
49
 
50
50
  def core_utilization(from, to)
@@ -0,0 +1 @@
1
+ cd rep
@@ -157,11 +157,12 @@ class API
157
157
  end
158
158
  js = checked_json(body, %w[account])
159
159
  a = js["account"]
160
+ account_id = a['id'].to_i
160
161
  plan = a['plan'].to_i
161
162
  storage_size = a['storage_size'].to_i
162
163
  guaranteed_cores = a['guaranteed_cores'].to_i
163
164
  maximum_cores = a['maximum_cores'].to_i
164
- return [plan, storage_size, guaranteed_cores, maximum_cores]
165
+ return [account_id, plan, storage_size, guaranteed_cores, maximum_cores]
165
166
  end
166
167
 
167
168
  def account_core_utilization(from, to)
@@ -11,15 +11,16 @@ class Model
11
11
  end
12
12
 
13
13
  class Account < Model
14
- def initialize(client, 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)
15
15
  super(client)
16
+ @account_id = account_id
16
17
  @plan = plan
17
18
  @storage_size = storage_size
18
19
  @guaranteed_cores = guaranteed_cores
19
20
  @maximum_cores = maximum_cores
20
21
  end
21
22
 
22
- attr_reader :plan, :storage_size, :guaranteed_cores, :maximum_cores
23
+ attr_reader :account_id, :plan, :storage_size, :guaranteed_cores, :maximum_cores
23
24
 
24
25
  def storage_size_string
25
26
  if @storage_size <= 1024*1024
@@ -1,5 +1,5 @@
1
1
  module TreasureData
2
2
 
3
- VERSION = '0.8.34'
3
+ VERSION = '0.8.35'
4
4
 
5
5
  end
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.34
4
+ version: 0.8.35
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-10-17 00:00:00.000000000 Z
12
+ date: 2012-10-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack
@@ -70,6 +70,7 @@ files:
70
70
  - data/ca-bundle.crt
71
71
  - lib/td-client.rb
72
72
  - lib/td/client.rb
73
+ - lib/td/client/#cd#
73
74
  - lib/td/client/api.rb
74
75
  - lib/td/client/compat_gzip_reader.rb
75
76
  - lib/td/client/model.rb
@@ -98,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
99
  version: '0'
99
100
  requirements: []
100
101
  rubyforge_project:
101
- rubygems_version: 1.8.23
102
+ rubygems_version: 1.8.24
102
103
  signing_key:
103
104
  specification_version: 3
104
105
  summary: Treasure Data API library for Ruby