File Coverage

blib/lib/POE/Declare/Meta/Slot.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 0 1 0.0
total 24 25 96.0


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 4     4   68 use 5.008007;
  4         12  
  4         140  
44 4     4   21 use strict;
  4         7  
  4         109  
45 4     4   22 use warnings;
  4         6  
  4         127  
46              
47 4     4   18 use vars qw{$VERSION};
  4         30  
  4         206  
48             BEGIN {
49 4     4   130 $VERSION = '0.59';
50             }
51              
52             use Class::XSAccessor {
53 4         35 constructor => 'new',
54             getters => {
55             name => 'name',
56             },
57 4     4   3212 };
  4         13215  
58              
59             # By default, a slot contains nothing
60 12     12 0 49 sub as_perl { '' }
61              
62             1;
63              
64             =pod
65              
66             =head1 SUPPORT
67              
68             Bugs should be always be reported via the CPAN bug tracker at
69              
70             L
71              
72             For other issues, or commercial enhancement or support, contact the author.
73              
74             =head1 AUTHORS
75              
76             Adam Kennedy Eadamk@cpan.orgE
77              
78             =head1 SEE ALSO
79              
80             L, L
81              
82             =head1 COPYRIGHT
83              
84             Copyright 2006 - 2012 Adam Kennedy.
85              
86             This program is free software; you can redistribute
87             it and/or modify it under the same terms as Perl itself.
88              
89             The full text of the license can be found in the
90             LICENSE file included with this module.
91              
92             =cut