Class: Supabase::Storage::Types::Bucket

Inherits:
Struct
  • Object
show all
Defined in:
lib/supabase/storage/types.rb

Overview

Returned by list_buckets / get_bucket. Mirrors storage3’s BaseBucket fields.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#allowed_mime_typesObject

Returns the value of attribute allowed_mime_types

Returns:

  • (Object)

    the current value of allowed_mime_types



22
23
24
# File 'lib/supabase/storage/types.rb', line 22

def allowed_mime_types
  @allowed_mime_types
end

#created_atObject

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



22
23
24
# File 'lib/supabase/storage/types.rb', line 22

def created_at
  @created_at
end

#file_size_limitObject

Returns the value of attribute file_size_limit

Returns:

  • (Object)

    the current value of file_size_limit



22
23
24
# File 'lib/supabase/storage/types.rb', line 22

def file_size_limit
  @file_size_limit
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



22
23
24
# File 'lib/supabase/storage/types.rb', line 22

def id
  @id
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



22
23
24
# File 'lib/supabase/storage/types.rb', line 22

def name
  @name
end

#ownerObject

Returns the value of attribute owner

Returns:

  • (Object)

    the current value of owner



22
23
24
# File 'lib/supabase/storage/types.rb', line 22

def owner
  @owner
end

#publicObject

Returns the value of attribute public

Returns:

  • (Object)

    the current value of public



22
23
24
# File 'lib/supabase/storage/types.rb', line 22

def public
  @public
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



22
23
24
# File 'lib/supabase/storage/types.rb', line 22

def type
  @type
end

#updated_atObject

Returns the value of attribute updated_at

Returns:

  • (Object)

    the current value of updated_at



22
23
24
# File 'lib/supabase/storage/types.rb', line 22

def updated_at
  @updated_at
end

Class Method Details

.from_hash(hash) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/supabase/storage/types.rb', line 27

def self.from_hash(hash)
  return nil if hash.nil?

  h = hash.transform_keys(&:to_s)
  new(
    id:                 h["id"],
    name:               h["name"],
    owner:              h["owner"],
    public:             h["public"],
    file_size_limit:    h["file_size_limit"],
    allowed_mime_types: h["allowed_mime_types"],
    created_at:         h["created_at"],
    updated_at:         h["updated_at"],
    type:               h["type"]
  )
end