File Coverage

blib/lib/POE/Declare/Meta/Slot.pm
Criterion Covered Total %
statement 15 16 93.7
branch n/a
condition n/a
subroutine 6 7 85.7
pod n/a
total 21 23 91.3


line stmt bran cond sub pod time code
1             package POE::Declare::Meta::Slot;
2              
3             =pod
4              
5             =head1 NAME
6              
7             POE::Declare::Meta::Slot - Abstract base class for named class elements
8              
9             =head1 DESCRIPTION
10              
11             In L, each class is a simple controlled structure with a set
12             of named elements within it, known as "slots".
13              
14             Each slot uniquely occupies a name (just like in a HASH) except that in the
15             L model, that name is reserved across all resources (the
16             method name, the HASH key, and in some cases certain method names below the
17             root name as well).
18              
19             For example, a slot named "foo" of type C will consume the HASH key
20             "foo", have an accessor method "foo", and take a "foo" parameter in the
21             object constructor.
22              
23             A slot named "mytimeout" filled with a C will consume the
24             "mytimeout" HASH key, and may have methods such as C,
25             C and C.
26              
27             =head1 METHODS
28              
29             =head2 new
30              
31             # You cannot create a Slot directly
32             my $object = POE::Declare::Meta::Attribute->new(
33             name => 'foo',
34             );
35              
36             The default slot constructor takes a list of named parameters, and creates
37             a C-based object using them. The default implementation does not
38             check its parameters, as it expects them to be provided by other functions
39             which themselves will have already checked params.
40              
41             =cut
42              
43 7     7   115 use 5.008007;
  7         16  
44 7     7   22 use strict;
  7         9  
  7         109  
45 7     7   25 use warnings;
  7         7  
  7         144  
46              
47 7     7   20 use vars qw{$VERSION};
  7         8  
  7         247  
48             BEGIN {
49 7     7   135 $VERSION = '0.23_01';
50             }
51              
52             use Class::XSAccessor
53 7         38 constructor => 'new',
54             getters => {
55             name => 'name',
56 7     7   2515 };
  7         12085  
57              
58             # By default, a slot contains nothing
59 0     0     sub _compile { '' }
60              
61             1;
62              
63             =pod
64              
65             =head1 SUPPORT
66              
67             Bugs should be always be reported via the CPAN bug tracker at
68              
69             L
70              
71             For other issues, or commercial enhancement or support, contact the author.
72              
73             =head1 AUTHORS
74              
75             Adam Kennedy Eadamk@cpan.orgE
76              
77             =head1 SEE ALSO
78              
79             L, L
80              
81             =head1 COPYRIGHT
82              
83             Copyright 2006 - 2009 Adam Kennedy.
84              
85             This program is free software; you can redistribute
86             it and/or modify it under the same terms as Perl itself.
87              
88             The full text of the license can be found in the
89             LICENSE file included with this module.
90              
91             =cut