Class: WOWSQL::StorageQuota

Inherits:
Object
  • Object
show all
Defined in:
lib/wowsql/storage.rb

Overview

Storage quota / statistics information.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ StorageQuota

Returns a new instance of StorageQuota.



67
68
69
70
71
72
# File 'lib/wowsql/storage.rb', line 67

def initialize(data)
  @total_files = data['total_files'] || data[:total_files] || 0
  @total_size_bytes = data['total_size_bytes'] || data[:total_size_bytes] || 0
  @total_size_gb = data['total_size_gb'] || data[:total_size_gb] || 0
  @file_types = data['file_types'] || data[:file_types] || {}
end

Instance Attribute Details

#file_typesObject (readonly)

Returns the value of attribute file_types.



65
66
67
# File 'lib/wowsql/storage.rb', line 65

def file_types
  @file_types
end

#total_filesObject (readonly)

Returns the value of attribute total_files.



65
66
67
# File 'lib/wowsql/storage.rb', line 65

def total_files
  @total_files
end

#total_size_bytesObject (readonly)

Returns the value of attribute total_size_bytes.



65
66
67
# File 'lib/wowsql/storage.rb', line 65

def total_size_bytes
  @total_size_bytes
end

#total_size_gbObject (readonly)

Returns the value of attribute total_size_gb.



65
66
67
# File 'lib/wowsql/storage.rb', line 65

def total_size_gb
  @total_size_gb
end

Instance Method Details

#to_sObject Also known as: inspect



74
75
76
# File 'lib/wowsql/storage.rb', line 74

def to_s
  "StorageQuota(files=#{@total_files}, size=#{'%.4f' % @total_size_gb}GB)"
end