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(memory_cost:, time_cost:, threads:) ⇒ AlgoArgon2

Returns a new instance of AlgoArgon2.



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

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

Instance Attribute Details

#memory_costObject (readonly)

Returns the value of attribute memory_cost.



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

def memory_cost
  @memory_cost
end

#threadsObject (readonly)

Returns the value of attribute threads.



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

def threads
  @threads
end

#time_costObject (readonly)

Returns the value of attribute time_cost.



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

def time_cost
  @time_cost
end

Class Method Details

.from(map:) ⇒ Object



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

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

Instance Method Details

#to_mapObject



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

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