class Appwrite::Models::Collection

Attributes

attributes[R]
enabled[R]
id[R]
indexes[R]
name[R]
permission[R]
read[R]
write[R]

Public Class Methods

from(map:) click to toggle source
# File lib/appwrite/models/collection.rb, line 35
def self.from(map:)
    Collection.new(
        id: map["$id"],
        read: map["$read"],
        write: map["$write"],
        name: map["name"],
        enabled: map["enabled"],
        permission: map["permission"],
        attributes: map["attributes"],
        indexes: map["indexes"].map { |it| Index.from(map: it) }
    )
end
new( id:, read:, write:, name:, enabled:, permission:, attributes:, indexes: ) click to toggle source
# File lib/appwrite/models/collection.rb, line 15
def initialize(
    id:,
    read:,
    write:,
    name:,
    enabled:,
    permission:,
    attributes:,
    indexes:
)
    @id = id
    @read = read
    @write = write
    @name = name
    @enabled = enabled
    @permission = permission
    @attributes = attributes
    @indexes = indexes
end

Public Instance Methods

to_map() click to toggle source
# File lib/appwrite/models/collection.rb, line 48
def to_map
    {
        "$id": @id,
        "$read": @read,
        "$write": @write,
        "name": @name,
        "enabled": @enabled,
        "permission": @permission,
        "attributes": @attributes,
        "indexes": @indexes.map { |it| it.to_map }
    }
end