line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Venus::Role::Explainable; |
2
|
|
|
|
|
|
|
|
3
|
96
|
|
|
96
|
|
1851
|
use 5.018; |
|
96
|
|
|
|
|
334
|
|
4
|
|
|
|
|
|
|
|
5
|
96
|
|
|
96
|
|
579
|
use strict; |
|
96
|
|
|
|
|
218
|
|
|
96
|
|
|
|
|
2111
|
|
6
|
96
|
|
|
96
|
|
458
|
use warnings; |
|
96
|
|
|
|
|
179
|
|
|
96
|
|
|
|
|
2750
|
|
7
|
|
|
|
|
|
|
|
8
|
96
|
|
|
96
|
|
548
|
use Venus::Role 'fault'; |
|
96
|
|
|
|
|
203
|
|
|
96
|
|
|
|
|
801
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# AUDIT |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub AUDIT { |
13
|
199
|
|
|
199
|
0
|
654
|
my ($self, $from) = @_; |
14
|
|
|
|
|
|
|
|
15
|
199
|
|
33
|
|
|
1019
|
my $name = ref $self || $self; |
16
|
|
|
|
|
|
|
|
17
|
199
|
50
|
|
|
|
1795
|
if (!$from->can('explain')) { |
18
|
0
|
|
|
|
|
0
|
fault "${from} requires 'explain' to consume ${name}"; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
199
|
|
|
|
|
554
|
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, Awncorp, C. |
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 |