Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Module:Legislature/US/lower

From Wikipedia, the free encyclopedia
local p = {}

p.name = "House of Representatives"
p.majority = "R"

-- just some ideas below for stuff that might be useful to include here. this would be stuff that is specific to the US House and no other legislature

-- Data structure for non-voting members
local nonVotingMembers = {
    ["AS"] = {title = "Delegate", term = 2},
    ["DC"] = {title = "Delegate", term = 2},
    ["GU"] = {title = "Delegate", term = 2},
    ["MP"] = {title = "Delegate", term = 2},
    ["PR"] = {title = "Resident Commissioner", term = 4},
    ["VI"] = {title = "Delegate", term = 2}
}

-- Function: isNonVotingEntity
-- Returns the title and term length if the input corresponds to a 
-- U.S. House non-voting jurisdiction, otherwise returns nil.
-- Use: {{#invoke:USHouseData|isNonVotingEntity|Puerto Rico}}
function p.isNonVotingEntity(frame)
    local entity = frame.args[1]
    local info = nonVotingMembers[entity]
    
    if info then
        return info.title, info.term
    end
    return nil
end

return p