Class: Appwrite::Models::Environment

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, created_at:, updated_at:, project_id:, name:) ⇒ Environment

Returns a new instance of Environment.



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

def initialize(
    id:,
    created_at:,
    updated_at:,
    project_id:,
    name:
)
    @id = id
    @created_at = created_at
    @updated_at = updated_at
    @project_id = project_id
    @name = name
end

Instance Attribute Details

#created_at ⇒ Object (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#id ⇒ Object (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#name ⇒ Object (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#project_id ⇒ Object (readonly)

Returns the value of attribute project_id.



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

def project_id
  @project_id
end

#updated_at ⇒ Object (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

Class Method Details

.from(map:) ⇒ Object



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

def self.from(map:)
    map = { "$id" => "", "$createdAt" => "", "$updatedAt" => "", "projectId" => "", "name" => "" }.merge(map)
    Environment.new(
        id: map["$id"],
        created_at: map["$createdAt"],
        updated_at: map["$updatedAt"],
        project_id: map["projectId"],
        name: map["name"]
    )
end

Instance Method Details

#to_map ⇒ Object



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

def to_map
    {
        "$id": @id,
        "$createdAt": @created_at,
        "$updatedAt": @updated_at,
        "projectId": @project_id,
        "name": @name
    }
end