-
Notifications
You must be signed in to change notification settings - Fork 145
Cache
SinisterRectus edited this page Nov 6, 2016
·
17 revisions
Name | Type | Mutable | Description |
---|---|---|---|
count | number | How many objects are cached |
Prototype | Description |
---|---|
add(obj) | Adds an object to the cache. Must match the defined type. |
find(predicate) | Returns the first object found that satisfies a predicate. |
findAll(predicate) | Returns an iterator for all objects that satisfy a predicate. |
get([key,] value) | Returns the first object that matches provided (key, value) pair. |
getAll([key, value]) | Returns an iterator for all objects that match the (key, value) pair. |
has(obj) | Returns a boolean indicating whether the cache contains the specified object. |
iter() | Returns an iterator for the objects in the queue. Order is not guaranteed. |
keys() | Returns an array-like Lua table of all of the cached objects' keys, sorted by key. |
merge(array) | Adds many new Discord object from an array of JSON data tables. |
new(data) | Adds a new Discord object from a JSON data table and returns the object. |
remove(obj) | Remove an object from the cache. Must match the defined type. |
values() | Returns an array-like Lua table of all of the cached objects, sorted by key. |