From 821a83c1292f53363b9c46bbec41c7170c6e532b Mon Sep 17 00:00:00 2001 From: Paul Liverman III Date: Wed, 7 Mar 2018 23:23:50 -0800 Subject: [PATCH] settings.delete fn --- settings.moon | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/settings.moon b/settings.moon index 142ce27..6624659 100644 --- a/settings.moon +++ b/settings.moon @@ -64,6 +64,15 @@ settings = { cache[setting.name] = setting settings[setting.name] = totype setting.value return settings + + delete: (name) -> + setting = cache[name] + unless setting + setting = Settings\find :name + if setting + setting\delete! + cache[name] = nil + settings[name] = nil } return setmetatable settings, {