In init.lua, you pass the namespace as a parameter to the function returned by dofile()
Code: Select all
local this = {}
dofile(mod_path .. "/helpers.lua")(this)
dofile(mod_path .. "/tools.lua")(this)
Code: Select all
local this
local function bar(whatever)
-- add functionality here
this.foo()
end
return function (parent)
this = parent
end
Code: Select all
local this = ...
local function bar(whatever)
-- add functionality here
this.foo()
end