Class: Supabase::Auth::Types::Identity

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



57
58
59
# File 'lib/supabase/auth/types.rb', line 57

def created_at
  @created_at
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



57
58
59
# File 'lib/supabase/auth/types.rb', line 57

def id
  @id
end

#identity_dataObject

Returns the value of attribute identity_data

Returns:

  • (Object)

    the current value of identity_data



57
58
59
# File 'lib/supabase/auth/types.rb', line 57

def identity_data
  @identity_data
end

#identity_idObject

Returns the value of attribute identity_id

Returns:

  • (Object)

    the current value of identity_id



57
58
59
# File 'lib/supabase/auth/types.rb', line 57

def identity_id
  @identity_id
end

#last_sign_in_atObject

Returns the value of attribute last_sign_in_at

Returns:

  • (Object)

    the current value of last_sign_in_at



57
58
59
# File 'lib/supabase/auth/types.rb', line 57

def 
  @last_sign_in_at
end

#providerObject

Returns the value of attribute provider

Returns:

  • (Object)

    the current value of provider



57
58
59
# File 'lib/supabase/auth/types.rb', line 57

def provider
  @provider
end

#updated_atObject

Returns the value of attribute updated_at

Returns:

  • (Object)

    the current value of updated_at



57
58
59
# File 'lib/supabase/auth/types.rb', line 57

def updated_at
  @updated_at
end

#user_idObject

Returns the value of attribute user_id

Returns:

  • (Object)

    the current value of user_id



57
58
59
# File 'lib/supabase/auth/types.rb', line 57

def user_id
  @user_id
end

Class Method Details

.from_hash(hash) ⇒ Object



68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/supabase/auth/types.rb', line 68

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

  new(
    id: hash["id"] || hash[:id],
    identity_id: hash["identity_id"] || hash[:identity_id],
    user_id: hash["user_id"] || hash[:user_id],
    identity_data: hash["identity_data"] || hash[:identity_data] || {},
    provider: hash["provider"] || hash[:provider],
    last_sign_in_at: Types.parse_timestamp(hash["last_sign_in_at"] || hash[:last_sign_in_at]),
    created_at: Types.parse_timestamp(hash["created_at"] || hash[:created_at]),
    updated_at: Types.parse_timestamp(hash["updated_at"] || hash[:updated_at])
  )
end