line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Venus::Role::Explainable; |
2
|
|
|
|
|
|
|
|
3
|
87
|
|
|
87
|
|
1668
|
use 5.018; |
|
87
|
|
|
|
|
433
|
|
4
|
|
|
|
|
|
|
|
5
|
87
|
|
|
87
|
|
458
|
use strict; |
|
87
|
|
|
|
|
175
|
|
|
87
|
|
|
|
|
1765
|
|
6
|
87
|
|
|
87
|
|
402
|
use warnings; |
|
87
|
|
|
|
|
164
|
|
|
87
|
|
|
|
|
2509
|
|
7
|
|
|
|
|
|
|
|
8
|
87
|
|
|
87
|
|
468
|
use Venus::Role 'fault'; |
|
87
|
|
|
|
|
166
|
|
|
87
|
|
|
|
|
772
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# AUDIT |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub AUDIT { |
13
|
174
|
|
|
174
|
0
|
498
|
my ($self, $from) = @_; |
14
|
|
|
|
|
|
|
|
15
|
174
|
|
33
|
|
|
835
|
my $name = ref $self || $self; |
16
|
|
|
|
|
|
|
|
17
|
174
|
50
|
|
|
|
1720
|
if (!$from->can('explain')) { |
18
|
0
|
|
|
|
|
0
|
fault "${from} requires 'explain' to consume ${name}"; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
174
|
|
|
|
|
476
|
return $self; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 NAME |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Venus::Role::Explainable - Explainable Role |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 ABSTRACT |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Explainable Role for Perl 5 |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 SYNOPSIS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
package Example; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
use Venus::Class; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
attr 'test'; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub explain { |
49
|
|
|
|
|
|
|
"okay" |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
with 'Venus::Role::Explainable'; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
package main; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
my $example = Example->new(test => 123); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# $example->explain; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=cut |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 DESCRIPTION |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
This package modifies the consuming package and provides methods for making the |
65
|
|
|
|
|
|
|
object stringifiable. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 METHODS |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This package provides the following methods: |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 explain |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
explain() (Any) |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
The explain method takes no arguments and returns the value to be used in |
80
|
|
|
|
|
|
|
stringification operations. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
I> |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=over 4 |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item explain example 1 |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
package main; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
my $example = Example->new(test => 123); |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
my $explain = $example->explain; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
# "okay" |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=back |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=cut |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 AUTHORS |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Awncorp, C |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=cut |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 LICENSE |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Copyright (C) 2000, Al Newkirk. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
This program is free software, you can redistribute it and/or modify it under |
111
|
|
|
|
|
|
|
the terms of the Apache license version 2.0. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=cut |