From c668600cd430ea188f52c549642e12f4bf7f38d7 Mon Sep 17 00:00:00 2001 From: 4n0n <4n0n@tinkr.site> Date: Thu, 2 Feb 2023 10:06:31 -0600 Subject: [PATCH] Cache emmy lua docs --- src/Cache/Cache.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Cache/Cache.lua b/src/Cache/Cache.lua index d2c75c1..2e4d6fb 100644 --- a/src/Cache/Cache.lua +++ b/src/Cache/Cache.lua @@ -3,12 +3,17 @@ local Cache = {} Cache.__index = Cache -- Constructor +---@return Cache function Cache:New() local self = setmetatable({}, Cache) self.cache = {} return self end +---@param key any +---@param value any +---@param duration number +---@return nil function Cache:Set(key, value, duration) self.cache = self.cache or {} self.cache[key] = { @@ -18,6 +23,8 @@ function Cache:Set(key, value, duration) } end +---@param key any +---@return any function Cache:Get(key) self.cache = self.cache or {} local cache = self.cache[key] @@ -31,6 +38,8 @@ function Cache:Get(key) return nil end +---@param key any +---@return boolean function Cache:IsCached(key) self.cache = self.cache or {} local cache = self.cache[key]