Class: Appwrite::Models::AlgoArgon2

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, memory_cost:, time_cost:, threads:) ⇒ AlgoArgon2

Returns a new instance of AlgoArgon2.



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

def initialize(
    type:,
    memory_cost:,
    time_cost:,
    threads:
)
    @type = type
    @memory_cost = memory_cost
    @time_cost = time_cost
    @threads = threads
end

Instance Attribute Details

#memory_costObject (readonly)

Returns the value of attribute memory_cost.



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

def memory_cost
  @memory_cost
end

#threadsObject (readonly)

Returns the value of attribute threads.



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

def threads
  @threads
end

#time_costObject (readonly)

Returns the value of attribute time_cost.



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

def time_cost
  @time_cost
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Class Method Details

.from(map:) ⇒ Object



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

def self.from(map:)
    AlgoArgon2.new(
        type: map["type"],
        memory_cost: map["memoryCost"],
        time_cost: map["timeCost"],
        threads: map["threads"]
    )
end

Instance Method Details

#to_mapObject



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

def to_map
    {
        "type": @type,
        "memoryCost": @memory_cost,
        "timeCost": @time_cost,
        "threads": @threads
    }
end