Class: WOWSQL::StorageBucket

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

Overview

Bucket information.

Instance Attribute Summary collapse

Instance Method Summary collapse

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_typesObject (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_atObject (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_limitObject (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

#idObject (readonly)

Returns the value of attribute id.



12
13
14
# File 'lib/wowsql/storage.rb', line 12

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



12
13
14
# File 'lib/wowsql/storage.rb', line 12

def name
  @name
end

#object_countObject (readonly)

Returns the value of attribute object_count.



12
13
14
# File 'lib/wowsql/storage.rb', line 12

def object_count
  @object_count
end

#publicObject (readonly)

Returns the value of attribute public.



12
13
14
# File 'lib/wowsql/storage.rb', line 12

def public
  @public
end

#total_sizeObject (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_sObject Also known as: inspect



26
27
28
# File 'lib/wowsql/storage.rb', line 26

def to_s
  "StorageBucket(name=#{@name.inspect}, public=#{@public})"
end