| Algorithm-Voting documentation | view source | Contained in the Algorithm-Voting distribution. |
Algorithm::Voting::Ballot - represents a ballot to cast in a race
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');
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.
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')
Returns a scalar (presumably a string, although this is not enforced) containing the candidate for whom this ballot is cast.
| Algorithm-Voting documentation | view source | Contained in the Algorithm-Voting distribution. |