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