Ir al contenido

Módulo:Zona de pruebas/angus/t

De Wikipedia, la enciclopedia libre
Este módulo no tiene página de documentación[crear]
local t = {}

function t.ge (frame)
  local e = mw.wikibase.getEntityObject()
  return e:getLabel()
end

function t.dumpwb (frame)
  local s = {}
  for name, tbl in pairs({wikibase = mw.wikibase,
                          entity = mw.wikibase.entity,
                          ["esta entidad"] = mw.wikibase.getEntityObject()}) do
    s[#s+1] = "====" .. name .. "===="
    local ss = {}
    for k,v in pairs(tbl) do
      ss[#ss+1] = tostring(k) .. ":" .. type(v)
    end
    s[#s+1] = table.concat(ss, " - ")
  end
  return table.concat(s, "\n\n")
end

function t.dumpe (e, prf)
  local str = { "" }
  for k,v in pairs(e) do
    local strv
    if type(v) == "table" then
      strv = t.dumpe(v, prf .. "*")
    else
      strv = tostring(v)
    end
    str[#str+1] = prf .. tostring(k) .. " ==> " .. strv
  end
  return table.concat(str, "\n")
end

function t.gt (frame)
  local e = mw.wikibase.getEntityObject()
  return t.dumpe(e, "*")
end

return t