FANDOM


-- <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("Parámetro no reconocido: ''" .. args[1] .. "''", "LuaError")
    end
 
    if type(s) == "table" then
        return s[tonumber(args[2])]
    else
        return s
    end
end
 
return p
-- </pre>
-- [[Category:Lua]]
El contenido de la comunidad está disponible bajo CC-BY-SA a menos que se indique lo contrario.