Class: Appwrite::Models::MockNumber

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(number:, otp:, created_at:, updated_at:) ⇒ MockNumber

Returns a new instance of MockNumber.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/appwrite/models/mock_number.rb', line 11

def initialize(
    number:,
    otp:,
    created_at:,
    updated_at:
)
    @number = number
    @otp = otp
    @created_at = created_at
    @updated_at = updated_at
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#numberObject (readonly)

Returns the value of attribute number.



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

def number
  @number
end

#otpObject (readonly)

Returns the value of attribute otp.



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

def otp
  @otp
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



9
10
11
# File 'lib/appwrite/models/mock_number.rb', line 9

def updated_at
  @updated_at
end

Class Method Details

.from(map:) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/appwrite/models/mock_number.rb', line 23

def self.from(map:)
    MockNumber.new(
        number: map["number"],
        otp: map["otp"],
        created_at: map["$createdAt"],
        updated_at: map["$updatedAt"]
    )
end

Instance Method Details

#to_mapObject



32
33
34
35
36
37
38
39
# File 'lib/appwrite/models/mock_number.rb', line 32

def to_map
    {
        "number": @number,
        "otp": @otp,
        "$createdAt": @created_at,
        "$updatedAt": @updated_at
    }
end