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.