View on
MetaCPAN
search.cpan.org is shutting down
For details read Perl NOC. After June 25th this page will redirect to MetaCPAN.org
John J. Trammell > Algorithm-Voting-0.01 > Algorithm::Voting::Ballot

Download:
Algorithm-Voting-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Algorithm::Voting::Ballot - represents a ballot to cast in a race

SYNOPSIS ^

    use Algorithm::Voting::Ballot;
    my $ballot = Algorithm::Voting::Ballot->new('Pedro');

Or equivalently:

    use Algorithm::Voting::Ballot;
    my $ballot = Algorithm::Voting::Ballot->new(candidate => 'Pedro');

DESCRIPTION ^

Instances of this class contain the information specified on a ballot. Expect this class to gain complexity as more complicated voting systems (e.g. IRV, Condorcet) are implemented.

METHODS ^

Algorithm::Voting::Ballot->new()

Constructs a new ballot object. Currently only suitable for indicating a single candidate, e.g. for Plurality ballots.

    # vote for Pedro
    my $ballot = Algorithm::Voting::Ballot->new('Pedro')

$ballot->candidate()

Returns a scalar (presumably a string, although this is not enforced) containing the candidate for whom this ballot is cast.

syntax highlighting: