Class: WOWSQL::StorageBucket
- Inherits:
-
Object
- Object
- WOWSQL::StorageBucket
- Defined in:
- lib/wowsql/storage.rb
Overview
Bucket information.
Instance Attribute Summary collapse
-
#allowed_mime_types ⇒ Object
readonly
Returns the value of attribute allowed_mime_types.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#file_size_limit ⇒ Object
readonly
Returns the value of attribute file_size_limit.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#object_count ⇒ Object
readonly
Returns the value of attribute object_count.
-
#public ⇒ Object
readonly
Returns the value of attribute public.
-
#total_size ⇒ Object
readonly
Returns the value of attribute total_size.
Instance Method Summary collapse
-
#initialize(data) ⇒ StorageBucket
constructor
A new instance of StorageBucket.
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(data) ⇒ StorageBucket
Returns a new instance of StorageBucket.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/wowsql/storage.rb', line 15 def initialize(data) @id = data['id'] || data[:id] || '' @name = data['name'] || data[:name] || '' @public = !!(data['public'] || data[:public]) @file_size_limit = data['file_size_limit'] || data[:file_size_limit] @allowed_mime_types = data['allowed_mime_types'] || data[:allowed_mime_types] @created_at = data['created_at'] || data[:created_at] @object_count = data['object_count'] || data[:object_count] || 0 @total_size = data['total_size'] || data[:total_size] || 0 end |
Instance Attribute Details
#allowed_mime_types ⇒ Object (readonly)
Returns the value of attribute allowed_mime_types.
12 13 14 |
# File 'lib/wowsql/storage.rb', line 12 def allowed_mime_types @allowed_mime_types end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
12 13 14 |
# File 'lib/wowsql/storage.rb', line 12 def created_at @created_at end |
#file_size_limit ⇒ Object (readonly)
Returns the value of attribute file_size_limit.
12 13 14 |
# File 'lib/wowsql/storage.rb', line 12 def file_size_limit @file_size_limit end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
12 13 14 |
# File 'lib/wowsql/storage.rb', line 12 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/wowsql/storage.rb', line 12 def name @name end |
#object_count ⇒ Object (readonly)
Returns the value of attribute object_count.
12 13 14 |
# File 'lib/wowsql/storage.rb', line 12 def object_count @object_count end |
#public ⇒ Object (readonly)
Returns the value of attribute public.
12 13 14 |
# File 'lib/wowsql/storage.rb', line 12 def public @public end |
#total_size ⇒ Object (readonly)
Returns the value of attribute total_size.
12 13 14 |
# File 'lib/wowsql/storage.rb', line 12 def total_size @total_size end |
Instance Method Details
#to_s ⇒ Object Also known as: inspect
26 27 28 |
# File 'lib/wowsql/storage.rb', line 26 def to_s "StorageBucket(name=#{@name.inspect}, public=#{@public})" end |