Class: Appwrite::Models::AlgoScrypt

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cost_cpu:, cost_memory:, cost_parallel:, length:) ⇒ AlgoScrypt

Returns a new instance of AlgoScrypt.



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

def initialize(
    cost_cpu:,
    cost_memory:,
    cost_parallel:,
    length:
)
    @cost_cpu = cost_cpu
    @cost_memory = cost_memory
    @cost_parallel = cost_parallel
    @length = length
end

Instance Attribute Details

#cost_cpuObject (readonly)

Returns the value of attribute cost_cpu.



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

def cost_cpu
  @cost_cpu
end

#cost_memoryObject (readonly)

Returns the value of attribute cost_memory.



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

def cost_memory
  @cost_memory
end

#cost_parallelObject (readonly)

Returns the value of attribute cost_parallel.



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

def cost_parallel
  @cost_parallel
end

#lengthObject (readonly)

Returns the value of attribute length.



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

def length
  @length
end

Class Method Details

.from(map:) ⇒ Object



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

def self.from(map:)
    AlgoScrypt.new(
        cost_cpu: map["costCpu"],
        cost_memory: map["costMemory"],
        cost_parallel: map["costParallel"],
        length: map["length"]
    )
end

Instance Method Details

#to_mapObject



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

def to_map
    {
        "costCpu": @cost_cpu,
        "costMemory": @cost_memory,
        "costParallel": @cost_parallel,
        "length": @length
    }
end