Class: WorkOS::Passwordless::PasswordlessSession

Inherits:
Struct
  • Object
show all
Defined in:
lib/workos/passwordless.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#emailObject

Returns the value of attribute email

Returns:

  • (Object)

    the current value of email



15
16
17
# File 'lib/workos/passwordless.rb', line 15

def email
  @email
end

#expires_atObject

Returns the value of attribute expires_at

Returns:

  • (Object)

    the current value of expires_at



15
16
17
# File 'lib/workos/passwordless.rb', line 15

def expires_at
  @expires_at
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



15
16
17
# File 'lib/workos/passwordless.rb', line 15

def id
  @id
end

Returns the value of attribute link

Returns:

  • (Object)

    the current value of link



15
16
17
# File 'lib/workos/passwordless.rb', line 15

def link
  @link
end

#objectObject

Returns the value of attribute object

Returns:

  • (Object)

    the current value of object



15
16
17
# File 'lib/workos/passwordless.rb', line 15

def object
  @object
end

Class Method Details

.from_hash(hash) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/workos/passwordless.rb', line 16

def self.from_hash(hash)
  new(
    id: hash["id"],
    email: hash["email"],
    expires_at: hash["expires_at"],
    link: hash["link"],
    object: hash["object"] || "passwordless_session"
  )
end

Instance Method Details

#to_hObject



26
27
28
# File 'lib/workos/passwordless.rb', line 26

def to_h
  super.compact
end