Module:RumorUtil

local util_args = require('Module:ArgsUtil') local util_vars = require("Module:VarsUtil")

local STATUSES = { confirmed = { store = 'Confirmed', display = 'Confirmed!', class = 'right', isover = true, }, ['confirmed!'] = { store = 'Confirmed', display = 'Confirmed!', class = 'right', isover = true, }, ['wrong role'] = { store = 'Wrong Role', display = 'Wrong Role', class = 'right', isover = true, }, tryout = { store = 'Tryout', display = 'Tryout', class = 'tbd', isover = false, }, leak = { store = 'Leak', display = 'Leak', class = 'tbd', isover = false, }, rumor = { store = 'Rumor', display = 'Rumor', class = 'tbd', isover = false, }, disproven = { store = 'Disproven', display = 'Disproven', class = 'wrong', isover = true, }, prank = { store = 'Prank', display = 'Prank!', class = 'wrong', isover = true, }, unsuccessful = { store = 'Unsuccessful', display = 'Unsuccessful', class = 'wrong', isover = true, }, }

local h = {}

local p = {}

function p.statusClass(str) if not str then return nil end str = str:lower if not STATUSES[str] then error(('Invalid status: %s'):format(str)) end return ('roster-rumor-%s'):format(STATUSES[str].class) end

function p.statusStore(str) if not str then return nil end return STATUSES[str:lower].store end

function p.statusDisplay(str) if not str then return nil end return STATUSES[str:lower].display end

function p.statusIsOver(str) if not str then return nil end return STATUSES[str:lower].isover end

function p.pageToRefresh(region) if not region then return nil end return ('Roster Swaps/%s/%s'):format(		util_vars.getVar('rumorPhase') or '',		region	) end

return p