Im trying to create a utility "class" wich returns "allObjects" either by function or directly.
Objects are files within a specified folder with a specified extension.
local Handler = {object = {}}
local workspace = {
shell.getWorkingDirectory().."dir1",
shell.getWorkingDirectory().."dir2"
}
for key, dir in pairs(workspace) do
for element in fs.list(dir) do
local s, e = string.find(element, "%.")
local ext = string.sub(element, s + 1)
local title = string.sub(element, 1, s - 1)
if ext == "foo" or ext == "bar" then
if Handler.object[ext]