class TreasureData::Account
Attributes
@!attribute [r] account_id
@!attribute [r] plan @!attribute [r] storage_size
@!attribute [r] guaranteed_cores
@!attribute [r] maximum_cores
@!attribute [r] account_id
@!attribute [r] plan @!attribute [r] storage_size
@!attribute [r] guaranteed_cores
@!attribute [r] maximum_cores
@!attribute [r] account_id
@!attribute [r] plan @!attribute [r] storage_size
@!attribute [r] guaranteed_cores
@!attribute [r] maximum_cores
@!attribute [r] account_id
@!attribute [r] plan @!attribute [r] storage_size
@!attribute [r] guaranteed_cores
@!attribute [r] maximum_cores
@!attribute [r] account_id
@!attribute [r] plan @!attribute [r] storage_size
@!attribute [r] guaranteed_cores
@!attribute [r] maximum_cores
Public Class Methods
@param [TreasureData::Client] client @param [String] account_id
@param [Fixnum] plan @param [Fixnum] storage_size
@param [Fixnum] guaranteed_cores
@param [Fixnum] maximum_cores
@param [String] created_at
TreasureData::Model::new
# File lib/td/client/model.rb, line 24 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
Public Instance Methods
@return <Time, nil>
# File lib/td/client/model.rb, line 42 def created_at @created_at && !@created_at.empty? ? Time.parse(@created_at) : nil end
@return <String>
# File lib/td/client/model.rb, line 47 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