Class: Supabase::Auth::Types::Factor

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



34
35
36
# File 'lib/supabase/auth/types.rb', line 34

def created_at
  @created_at
end

#factor_typeObject

Returns the value of attribute factor_type

Returns:

  • (Object)

    the current value of factor_type



34
35
36
# File 'lib/supabase/auth/types.rb', line 34

def factor_type
  @factor_type
end

#friendly_nameObject

Returns the value of attribute friendly_name

Returns:

  • (Object)

    the current value of friendly_name



34
35
36
# File 'lib/supabase/auth/types.rb', line 34

def friendly_name
  @friendly_name
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



34
35
36
# File 'lib/supabase/auth/types.rb', line 34

def id
  @id
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



34
35
36
# File 'lib/supabase/auth/types.rb', line 34

def status
  @status
end

#updated_atObject

Returns the value of attribute updated_at

Returns:

  • (Object)

    the current value of updated_at



34
35
36
# File 'lib/supabase/auth/types.rb', line 34

def updated_at
  @updated_at
end

Class Method Details

.from_hash(hash) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/supabase/auth/types.rb', line 43

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

  new(
    id: hash["id"] || hash[:id],
    friendly_name: hash["friendly_name"] || hash[:friendly_name],
    factor_type: hash["factor_type"] || hash[:factor_type],
    status: hash["status"] || hash[:status],
    created_at: Types.parse_timestamp(hash["created_at"] || hash[:created_at]),
    updated_at: Types.parse_timestamp(hash["updated_at"] || hash[:updated_at])
  )
end