Technorati/BaseTechnoratiObject.pm untested

filter: Statementstmt 0.0% 0 / 30 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 63 CC 3 SCAR 16.7
CC
3
Cov
0%
AUTOLOAD
12.0
_accessible
2.0
BEGIN
2.0
CRAP 5.3
1 package WebService::Technorati::BaseTechnoratiObject;
2 use strict;
3 use utf8;
4  
5 use vars qw($AUTOLOAD);
6 use AutoLoader;
7  
8 use WebService::Technorati::Exception;
9  
10 sub AUTOLOAD {
11 my $self=shift;
12 my $change=shift;
13 my $class = ref($self) || $self;
14 my($type,$field) = $AUTOLOAD =~ /.*::((?:s|g)et)([A-Z]\w+)/;
15 if (! defined($field)) {
16 WebService::Technorati::MethodNotImplementedException->throw(
17 "method not implemented: $AUTOLOAD");
18 }
19 $field = lc($field);
20 $self->_accessible($field)
21 || WebService::Technorati::AccessViolationException->throw(
22 "attribute not accessible in $class: $field $AUTOLOAD");
23 if ($change && $type eq 'set') {
24 $self->{$field}=$change;
25 }
26 return $self->{$field};
27 } # AUTOLOAD
28  
29 sub _accessible {
30 my $self = shift;
31 my $class = ref($self) || $self;
32 WebService::Technorati::MethodNotImplementedException->throw(
33 "abstract method '_accessible' not implemented by $class");
34 }
35  
36 1;
37  
38 __END__