class Appwrite::Models::Document

Attributes

collection[R]
id[R]
read[R]
write[R]

Public Class Methods

from(map:) click to toggle source
# File lib/appwrite/models/document.rb, line 25
def self.from(map:)
    Document.new(
        id: map["$id"],
        collection: map["$collection"],
        read: map["$read"],
        write: map["$write"],
        data: map["data"]
    )
end
new( id:, collection:, read:, write:, data: ) click to toggle source
# 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

Public Instance Methods

convert_to(from_json) click to toggle source
# File lib/appwrite/models/document.rb, line 45
def convert_to(from_json)
    from_json.call(data)
end
to_map() click to toggle source
# File lib/appwrite/models/document.rb, line 35
def to_map
    {
        "$id": @id,
        "$collection": @collection,
        "$read": @read,
        "$write": @write,
        "data": @data
    }
end