Class: TreasureData::Account
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#guaranteed_cores ⇒ Object
readonly
Returns the value of attribute guaranteed_cores.
-
#maximum_cores ⇒ Object
readonly
Returns the value of attribute maximum_cores.
-
#plan ⇒ Object
readonly
Returns the value of attribute plan.
-
#storage_size ⇒ Object
readonly
Returns the value of attribute storage_size.
Attributes inherited from Model
Instance Method Summary collapse
- #created_at ⇒ Object
-
#initialize(client, account_id, plan, storage_size = nil, guaranteed_cores = nil, maximum_cores = nil, created_at = nil) ⇒ Account
constructor
A new instance of Account.
- #storage_size_string ⇒ Object
Constructor Details
#initialize(client, account_id, plan, storage_size = nil, guaranteed_cores = nil, maximum_cores = nil, created_at = nil) ⇒ Account
Returns a new instance of Account.
14 15 16 17 18 19 20 21 22 |
# File 'lib/td/client/model.rb', line 14 def initialize(client, account_id, plan, storage_size=nil, guaranteed_cores=nil, maximum_cores=nil, created_at=nil) super(client) @account_id = account_id @plan = plan @storage_size = storage_size @guaranteed_cores = guaranteed_cores @maximum_cores = maximum_cores @created_at = created_at end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
24 25 26 |
# File 'lib/td/client/model.rb', line 24 def account_id @account_id end |
#guaranteed_cores ⇒ Object (readonly)
Returns the value of attribute guaranteed_cores.
24 25 26 |
# File 'lib/td/client/model.rb', line 24 def guaranteed_cores @guaranteed_cores end |
#maximum_cores ⇒ Object (readonly)
Returns the value of attribute maximum_cores.
24 25 26 |
# File 'lib/td/client/model.rb', line 24 def maximum_cores @maximum_cores end |
#plan ⇒ Object (readonly)
Returns the value of attribute plan.
24 25 26 |
# File 'lib/td/client/model.rb', line 24 def plan @plan end |
#storage_size ⇒ Object (readonly)
Returns the value of attribute storage_size.
24 25 26 |
# File 'lib/td/client/model.rb', line 24 def storage_size @storage_size end |
Instance Method Details
#created_at ⇒ Object
26 27 28 |
# File 'lib/td/client/model.rb', line 26 def created_at @created_at && !@created_at.empty? ? Time.parse(@created_at) : nil end |
#storage_size_string ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/td/client/model.rb', line 30 def storage_size_string if @storage_size <= 1024 * 1024 return "0.0 GB" elsif @storage_size <= 60 * 1024 * 1024 return "0.01 GB" elsif @storage_size <= 60 * 1024 * 1024 * 1024 "%.1f GB" % (@storage_size.to_f / (1024 * 1024 * 1024)) else "%d GB" % (@storage_size.to_f / (1024 * 1024 * 1024)).to_i end end |