Class: Appwrite::Models::Team

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, name:, date_created:, total:) ⇒ Team

Returns a new instance of Team.



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

def initialize(
    id:,
    name:,
    date_created:,
    total:
)
    @id = id
    @name = name
    @date_created = date_created
    @total = total
end

Instance Attribute Details

#date_createdObject (readonly)

Returns the value of attribute date_created.



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

def date_created
  @date_created
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#totalObject (readonly)

Returns the value of attribute total.



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

def total
  @total
end

Class Method Details

.from(map:) ⇒ Object



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

def self.from(map:)
    Team.new(
        id: map["$id"],
        name: map["name"],
        date_created: map["dateCreated"],
        total: map["total"]
    )
end

Instance Method Details

#to_mapObject



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

def to_map
    {
        "$id": @id,
        "name": @name,
        "dateCreated": @date_created,
        "total": @total
    }
end