line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Object::Dumb; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2016-06-16'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '0.02'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
#use strict; |
7
|
|
|
|
|
|
|
#use warnings; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
4
|
|
|
4
|
0
|
3461
|
my $class = shift; |
11
|
4
|
|
|
|
|
8
|
my $o = {@_}; |
12
|
|
|
|
|
|
|
|
13
|
4
|
100
|
|
|
|
14
|
$o->{returns} = 0 if !exists($o->{returns}); |
14
|
4
|
|
|
|
|
8
|
bless $o, $class; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub AUTOLOAD { |
18
|
11
|
|
|
11
|
|
893
|
my $meth = $AUTOLOAD; $meth =~ s/.+:://; |
|
11
|
|
|
|
|
60
|
|
19
|
11
|
|
|
|
|
11
|
my $self = shift; |
20
|
11
|
100
|
|
|
|
23
|
if ($self->{methods}) { |
21
|
7
|
|
|
|
|
7
|
my $known = 0; |
22
|
7
|
100
|
|
|
|
18
|
if (ref($self->{methods}) eq 'ARRAY') { |
|
|
50
|
|
|
|
|
|
23
|
3
|
100
|
|
|
|
4
|
$known = 1 if grep { $_ eq $meth } @{ $self->{methods} }; |
|
6
|
|
|
|
|
15
|
|
|
3
|
|
|
|
|
4
|
|
24
|
|
|
|
|
|
|
} elsif (ref($self->{methods}) eq 'Regexp') { |
25
|
4
|
100
|
|
|
|
23
|
$known = 1 if $meth =~ $self->{methods}; |
26
|
|
|
|
|
|
|
} |
27
|
7
|
100
|
|
|
|
24
|
die "Unknown method '$meth'" unless $known; |
28
|
|
|
|
|
|
|
} |
29
|
9
|
|
|
|
|
28
|
return $self->{returns}; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
# ABSTRACT: A dumb object that responds to any method and just returns 0 |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |