line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id$ |
2
|
|
|
|
|
|
|
# $Source$ |
3
|
|
|
|
|
|
|
# $Author$ |
4
|
|
|
|
|
|
|
# $HeadURL$ |
5
|
|
|
|
|
|
|
# $Revision$ |
6
|
|
|
|
|
|
|
# $Date$ |
7
|
|
|
|
|
|
|
package Class::Dot::Meta::Accessor; |
8
|
|
|
|
|
|
|
|
9
|
16
|
|
|
16
|
|
83
|
use strict; |
|
16
|
|
|
|
|
31
|
|
|
16
|
|
|
|
|
544
|
|
10
|
16
|
|
|
16
|
|
80
|
use warnings; |
|
16
|
|
|
|
|
25
|
|
|
16
|
|
|
|
|
12222
|
|
11
|
16
|
|
|
16
|
|
164
|
use version; |
|
16
|
|
|
|
|
26
|
|
|
16
|
|
|
|
|
95
|
|
12
|
16
|
|
|
16
|
|
1254
|
use 5.00600; |
|
16
|
|
|
|
|
51
|
|
|
16
|
|
|
|
|
1318
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = qv('2.0.0_15'); |
15
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:ASKSH'; |
16
|
|
|
|
|
|
|
|
17
|
16
|
|
|
16
|
|
92
|
use Carp qw(croak); |
|
16
|
|
|
|
|
33
|
|
|
16
|
|
|
|
|
1127
|
|
18
|
16
|
|
|
16
|
|
91
|
use Class::Plugin::Util qw(load_plugins get_plugins); |
|
16
|
|
|
|
|
26
|
|
|
16
|
|
|
|
|
146
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
load_plugins(__PACKAGE__, [qw(Base)]); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
23
|
93
|
|
|
93
|
1
|
151
|
my ($class, $options_ref) = @_; |
24
|
|
|
|
|
|
|
|
25
|
93
|
|
|
|
|
216
|
my $wanted_type = ucfirst lc $options_ref->{type}; |
26
|
93
|
50
|
|
|
|
215
|
croak 'Missing accessor type' |
27
|
|
|
|
|
|
|
if not defined $wanted_type; |
28
|
|
|
|
|
|
|
|
29
|
93
|
|
|
|
|
253
|
my $accessor_classes = get_plugins(); |
30
|
|
|
|
|
|
|
|
31
|
93
|
50
|
|
|
|
1104
|
if (! exists $accessor_classes->{$wanted_type}) { |
32
|
0
|
|
|
|
|
0
|
croak "No such accessor type: $wanted_type"; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
93
|
|
|
|
|
156
|
my $accessor_class = $accessor_classes->{$wanted_type}; |
36
|
|
|
|
|
|
|
|
37
|
93
|
|
|
|
|
511
|
return $accessor_class->new($options_ref); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |