Class: Appwrite::Models::MfaFactors

Inherits:
Object
  • Object
show all
Defined in:
lib/appwrite/models/mfa_factors.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(totp:, phone:, email:) ⇒ MfaFactors

Returns a new instance of MfaFactors.



10
11
12
13
14
15
16
17
18
# File 'lib/appwrite/models/mfa_factors.rb', line 10

def initialize(
    totp:,
    phone:,
    email:
)
    @totp = totp
    @phone = phone
    @email = email
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



8
9
10
# File 'lib/appwrite/models/mfa_factors.rb', line 8

def email
  @email
end

#phoneObject (readonly)

Returns the value of attribute phone.



7
8
9
# File 'lib/appwrite/models/mfa_factors.rb', line 7

def phone
  @phone
end

#totpObject (readonly)

Returns the value of attribute totp.



6
7
8
# File 'lib/appwrite/models/mfa_factors.rb', line 6

def totp
  @totp
end

Class Method Details

.from(map:) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/appwrite/models/mfa_factors.rb', line 20

def self.from(map:)
    MfaFactors.new(
        totp: map["totp"],
        phone: map["phone"],
        email: map["email"]
    )
end

Instance Method Details

#to_mapObject



28
29
30
31
32
33
34
# File 'lib/appwrite/models/mfa_factors.rb', line 28

def to_map
    {
        "totp": @totp,
        "phone": @phone,
        "email": @email
    }
end