Class: Supabase::Auth::Types::AuthOtpResponse

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#message_idObject

Returns the value of attribute message_id

Returns:

  • (Object)

    the current value of message_id



253
254
255
# File 'lib/supabase/auth/types.rb', line 253

def message_id
  @message_id
end

#sessionObject

Returns the value of attribute session

Returns:

  • (Object)

    the current value of session



253
254
255
# File 'lib/supabase/auth/types.rb', line 253

def session
  @session
end

#userObject

Returns the value of attribute user

Returns:

  • (Object)

    the current value of user



253
254
255
# File 'lib/supabase/auth/types.rb', line 253

def user
  @user
end

Class Method Details

.from_hash(hash) ⇒ Object



259
260
261
262
263
264
265
266
267
# File 'lib/supabase/auth/types.rb', line 259

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

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