File Coverage

lib/Games/League/Member.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 3 3 100.0
total 27 27 100.0


line stmt bran cond sub pod time code
1             package Games::League::Member;
2              
3             # Last Edit: 2006 2月 11, 07時56分01秒
4             # $Id: /sched/trunk/lib/Games/League/Member.pm 515 2006-02-10T23:06:55.230562Z dv $
5              
6 11     11   7041 use warnings;
  11         23  
  11         349  
7 11     11   59 use strict;
  11         20  
  11         514  
8              
9 11     11   21450 use overload qw/0+/ => 'index', qw/""/ => 'name', fallback => 1;
  11         15139  
  11         83  
10              
11             =head1 NAME
12              
13             Games::League::Member - Objects which Games::Tournament::RoundRobin can pair
14              
15             =head1 VERSION
16              
17             Version 0.01
18              
19             =cut
20              
21             our $VERSION = '0.01';
22              
23             =head1 SYNOPSIS
24              
25             my $foo = Games::League::Member->new( index => '15', name => 'Your New Knicks' );
26             ...
27              
28             =head1 DESCRIPTION
29              
30             Games::Tournament::RoundRobin supports objects which have an index and a name method accessor, like this members of this class, Games::League::Member.
31              
32             Games::Tournament::RoundRobin will use this class when constructing a Bye member if the application does not supply one.
33              
34             =head1 REQUIREMENTS
35              
36             Module::Build to install.
37              
38             =head1 METHODS
39              
40             =head2 new
41              
42             Games::League::Member->new( index => '15', name => 'Your New Knicks' )
43              
44             =cut
45              
46             sub new
47             {
48 59     59 1 1015 my $class = shift;
49 59         199 my %args = @_;
50 59         100 my $index = $args{index};
51 59         84 my $name = $args{name};
52 59         916 return bless \%args, $class;
53             }
54              
55             =head2 name
56              
57             $member->name
58              
59             Returns the name of the league member, a string that may or may not be unique to the member.
60              
61             =cut
62              
63             sub name
64             {
65 508     508 1 15888 my $self = shift;
66 508         4218 return $self->{name};
67             }
68              
69             =head2 index
70              
71             $member->index
72              
73             Returns the index of the league member, a number unique to the member in the range 0 .. n-1.
74              
75             =cut
76              
77             sub index
78             {
79 85     85 1 161 my $self = shift;
80 85         832 return $self->{index};
81             }
82              
83             =head1 AUTHOR
84              
85             Dr Bean, C<< >>
86              
87             =head1 BUGS
88              
89             Please report any bugs or feature requests to
90             C, or through the web interface at
91             L.
92             I will be notified, and then you'll automatically be notified of progress on
93             your bug as I make changes.
94              
95             =head1 SUPPORT
96              
97             You can find documentation for this module with the perldoc command.
98              
99             perldoc Games::League::Member
100              
101             You can also look for information at:
102              
103             =over 4
104              
105             =item * AnnoCPAN: Annotated CPAN documentation
106              
107             L
108              
109             =item * CPAN Ratings
110              
111             L
112              
113             =item * RT: CPAN's request tracker
114              
115             L
116              
117             =item * Search CPAN
118              
119             L
120              
121             =back
122              
123             =head1 ACKNOWLEDGEMENTS
124              
125             Thanks to the perl community for (0;$every;1) {
126             $stacks .= $i;
127             }
128              
129             =head1 COPYRIGHT & LICENSE
130              
131             Copyright 2006 Dr Bean, all rights reserved.
132              
133             This program is free software; you can redistribute it and/or modify it
134             under the same terms as Perl itself.
135              
136             =cut
137              
138             1; # End of Games::League::Member