Class: Supabase::Auth::Types::AuthResponse

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#sessionObject

Returns the value of attribute session

Returns:

  • (Object)

    the current value of session



184
185
186
# File 'lib/supabase/auth/types.rb', line 184

def session
  @session
end

#userObject

Returns the value of attribute user

Returns:

  • (Object)

    the current value of user



184
185
186
# File 'lib/supabase/auth/types.rb', line 184

def user
  @user
end

Class Method Details

.from_hash(hash) ⇒ Object



189
190
191
192
193
194
195
196
# File 'lib/supabase/auth/types.rb', line 189

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

  new(
    user: User.from_hash(hash["user"] || hash[:user]),
    session: Session.from_hash(hash["session"] || hash[:session])
  )
end