aboutsummaryrefslogtreecommitdiffstats
path: root/core/moduleapi.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/moduleapi.lua')
-rw-r--r--core/moduleapi.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua
index 30360f73..da44db5f 100644
--- a/core/moduleapi.lua
+++ b/core/moduleapi.lua
@@ -270,6 +270,10 @@ function api:get_option_set(name, ...)
return set.new(value);
end
+function api:context(host)
+ return setmetatable({host=host or "*"}, {__index=self,__newindex=self});
+end
+
function api:add_item(key, value)
self.items = self.items or {};
self.items[key] = self.items[key] or {};