Class: WOWSQL::StorageQuota
- Inherits:
-
Object
- Object
- WOWSQL::StorageQuota
- Defined in:
- lib/wowsql/storage.rb
Overview
Storage quota / statistics information.
Instance Attribute Summary collapse
-
#file_types ⇒ Object
readonly
Returns the value of attribute file_types.
-
#total_files ⇒ Object
readonly
Returns the value of attribute total_files.
-
#total_size_bytes ⇒ Object
readonly
Returns the value of attribute total_size_bytes.
-
#total_size_gb ⇒ Object
readonly
Returns the value of attribute total_size_gb.
Instance Method Summary collapse
-
#initialize(data) ⇒ StorageQuota
constructor
A new instance of StorageQuota.
- #to_s ⇒ Object (also: #inspect)
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_types ⇒ Object (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_files ⇒ Object (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_bytes ⇒ Object (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_gb ⇒ Object (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_s ⇒ Object 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 |