Class: Appwrite::Models::Specification

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(memory:, cpus:, enabled:, slug:) ⇒ Specification

Returns a new instance of Specification.



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

def initialize(
    memory:,
    cpus:,
    enabled:,
    slug:
)
    @memory = memory
    @cpus = cpus
    @enabled = enabled
    @slug = slug
end

Instance Attribute Details

#cpusObject (readonly)

Returns the value of attribute cpus.



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

def cpus
  @cpus
end

#enabledObject (readonly)

Returns the value of attribute enabled.



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

def enabled
  @enabled
end

#memoryObject (readonly)

Returns the value of attribute memory.



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

def memory
  @memory
end

#slugObject (readonly)

Returns the value of attribute slug.



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

def slug
  @slug
end

Class Method Details

.from(map:) ⇒ Object



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

def self.from(map:)
    Specification.new(
        memory: map["memory"],
        cpus: map["cpus"],
        enabled: map["enabled"],
        slug: map["slug"]
    )
end

Instance Method Details

#to_mapObject



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

def to_map
    {
        "memory": @memory,
        "cpus": @cpus,
        "enabled": @enabled,
        "slug": @slug
    }
end