League of Legends Wiki

Want to contribute to this wiki?
Sign up for an account, and get started!
You can even turn off ads in your preferences.

Come join the LoL Wiki community Discord server!

READ MORE

League of Legends Wiki
Advertisement

Documentation for this module may be created at Module:Maintenance data/doc

-- <pre>
--- Returns the static maintenance data.
--- Used by [[Template:Current maintenance data]]
--- Syntax: {{cmd|<keyword>}} or {{current maintenance data|<keyword>}}

local p         = {}
local lib       = require('Module:Feature')
local userError = require('Dev:User error')
local keyword   = mw.loadData('Module:Maintenance data/data')

--% Entry point to use module
--@ frame (table) A scribunto frame
--: (string) The return content of the keyword or "N/A"
function p.main(frame)
    local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end
    
    local s = keyword[args[1]]
    if s == nil then
        return userError("Unrecognized parameter: ''" .. args[1] .. "''", "LuaError")
    end
    
    if type(s) == "table" then
        return s[tonumber(args[2])]
    else
        return s
    end
end

return p
-- </pre>
-- [[Category:Lua]]
Advertisement