Class: Supabase::Storage::Types::SearchV2Result

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#foldersObject

Returns the value of attribute folders

Returns:

  • (Object)

    the current value of folders



83
84
85
# File 'lib/supabase/storage/types.rb', line 83

def folders
  @folders
end

#has_nextObject Also known as: hasNext

Returns the value of attribute has_next

Returns:

  • (Object)

    the current value of has_next



83
84
85
# File 'lib/supabase/storage/types.rb', line 83

def has_next
  @has_next
end

#next_cursorObject Also known as: nextCursor

Returns the value of attribute next_cursor

Returns:

  • (Object)

    the current value of next_cursor



83
84
85
# File 'lib/supabase/storage/types.rb', line 83

def next_cursor
  @next_cursor
end

#objectsObject

Returns the value of attribute objects

Returns:

  • (Object)

    the current value of objects



83
84
85
# File 'lib/supabase/storage/types.rb', line 83

def objects
  @objects
end

Class Method Details

.from_hash(hash) ⇒ Object



87
88
89
90
91
92
93
94
95
96
97
# File 'lib/supabase/storage/types.rb', line 87

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

  h = hash.transform_keys(&:to_s)
  new(
    has_next:    h["hasNext"],
    folders:     Array(h["folders"]).map { |f| SearchV2Folder.from_hash(f) },
    objects:     Array(h["objects"]).map { |o| SearchV2Object.from_hash(o) },
    next_cursor: h["nextCursor"]
  )
end