Class: Appwrite::Models::Document
- Inherits:
-
Object
- Object
- Appwrite::Models::Document
- Defined in:
- lib/appwrite/models/document.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#read ⇒ Object
readonly
Returns the value of attribute read.
-
#write ⇒ Object
readonly
Returns the value of attribute write.
Class Method Summary collapse
Instance Method Summary collapse
- #convert_to(from_json) ⇒ Object
-
#initialize(id:, collection:, read:, write:, data:) ⇒ Document
constructor
A new instance of Document.
- #to_map ⇒ Object
Constructor Details
#initialize(id:, collection:, read:, write:, data:) ⇒ Document
Returns a new instance of Document.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/appwrite/models/document.rb', line 11 def initialize( id:, collection:, read:, write:, data: ) @id = id @collection = collection @read = read @write = write @data = data end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
7 8 9 |
# File 'lib/appwrite/models/document.rb', line 7 def collection @collection end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/appwrite/models/document.rb', line 6 def id @id end |
#read ⇒ Object (readonly)
Returns the value of attribute read.
8 9 10 |
# File 'lib/appwrite/models/document.rb', line 8 def read @read end |
#write ⇒ Object (readonly)
Returns the value of attribute write.
9 10 11 |
# File 'lib/appwrite/models/document.rb', line 9 def write @write end |
Class Method Details
Instance Method Details
#convert_to(from_json) ⇒ Object
45 46 47 |
# File 'lib/appwrite/models/document.rb', line 45 def convert_to(from_json) from_json.call(data) end |
#to_map ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/appwrite/models/document.rb', line 35 def to_map { "$id": @id, "$collection": @collection, "$read": @read, "$write": @write, "data": @data } end |