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(type:, cost_cpu:, cost_memory:, cost_parallel:, length:) ⇒ AlgoScrypt

Returns a new instance of AlgoScrypt.



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

def initialize(
    type:,
    cost_cpu:,
    cost_memory:,
    cost_parallel:,
    length:
)
    @type = type
    @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.



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

def cost_cpu
  @cost_cpu
end

#cost_memoryObject (readonly)

Returns the value of attribute cost_memory.



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

def cost_memory
  @cost_memory
end

#cost_parallelObject (readonly)

Returns the value of attribute cost_parallel.



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

def cost_parallel
  @cost_parallel
end

#lengthObject (readonly)

Returns the value of attribute length.



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

def length
  @length
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Class Method Details

.from(map:) ⇒ Object



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

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

Instance Method Details

#to_mapObject



36
37
38
39
40
41
42
43
44
# File 'lib/appwrite/models/algo_scrypt.rb', line 36

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