summaryrefslogtreecommitdiffstats
path: root/aconf/object.lua
diff options
context:
space:
mode:
Diffstat (limited to 'aconf/object.lua')
-rw-r--r--aconf/object.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/aconf/object.lua b/aconf/object.lua
index a81fbf8..dca59f6 100644
--- a/aconf/object.lua
+++ b/aconf/object.lua
@@ -1,5 +1,5 @@
--[[
-Copyright (c) 2012-2014 Kaarle Ritvanen
+Copyright (c) 2012-2015 Kaarle Ritvanen
See LICENSE file for license details
--]]
@@ -64,5 +64,9 @@ function M.isinstance(obj, cls)
return type(obj) == 'table' and mt.class and M.issubclass(mt.class, cls)
end
+function M.toinstance(obj, ...)
+ return getmetatable(obj).class and obj or obj(...)
+end
+
return M