Class: Appwrite::Models::PresenceList
- Inherits:
-
Object
- Object
- Appwrite::Models::PresenceList
- Defined in:
- lib/appwrite/models/presence_list.rb
Instance Attribute Summary collapse
-
#presences ⇒ Object
readonly
Returns the value of attribute presences.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Class Method Summary collapse
Instance Method Summary collapse
- #convert_to(from_json) ⇒ Object
-
#initialize(total:, presences:) ⇒ PresenceList
constructor
A new instance of PresenceList.
- #to_map ⇒ Object
Constructor Details
#initialize(total:, presences:) ⇒ PresenceList
Returns a new instance of PresenceList.
9 10 11 12 13 14 15 |
# File 'lib/appwrite/models/presence_list.rb', line 9 def initialize( total:, presences: ) @total = total @presences = presences end |
Instance Attribute Details
#presences ⇒ Object (readonly)
Returns the value of attribute presences.
7 8 9 |
# File 'lib/appwrite/models/presence_list.rb', line 7 def presences @presences end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
6 7 8 |
# File 'lib/appwrite/models/presence_list.rb', line 6 def total @total end |
Class Method Details
.from(map:) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/appwrite/models/presence_list.rb', line 17 def self.from(map:) PresenceList.new( total: map["total"], presences: map["presences"].map { |it| Presence.from(map: it) } ) end |
Instance Method Details
#convert_to(from_json) ⇒ Object
31 32 33 |
# File 'lib/appwrite/models/presence_list.rb', line 31 def convert_to(from_json) presences.map { |it| it.convert_to(from_json) } end |
#to_map ⇒ Object
24 25 26 27 28 29 |
# File 'lib/appwrite/models/presence_list.rb', line 24 def to_map { "total": @total, "presences": @presences.map { |it| it.to_map } } end |