Jump to content

Module:Ru Paul's Drag Race tables

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Wugapodes (talk | contribs) at 00:16, 11 July 2020 (contestant parsing). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {} --p stands for package

function p.main( frame )
    templateFrame = frame:getParent()
    contestantData = {}
    ret = ''
    for k, v in pairs( templateFrame.args ) do
    		ret = ret .. _getContestant(k) .. _getField(k) .. ' = ' .. v .. "\n"
    end
    return ret
end

local function _getContestant( k )
	return string.gmatch( k, "contestant\s(\d+)" )
end

local function _getField( k )
	return string.gmatch( k, "contestant\s\d+-(.*)")
end

return p