line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Object::Class; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
399239
|
use 5.014; |
|
1
|
|
|
|
|
4
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
5
|
use parent 'Moo'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '2.02'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
1; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=encoding utf8 |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Data::Object::Class |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=cut |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 ABSTRACT |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Class Builder for Perl 5 |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 SYNOPSIS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
package Identity; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
use Data::Object::Class; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
package main; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my $id = Identity->new; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 DESCRIPTION |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
This package modifies the consuming package making it a class. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 INHERITS |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
This package inherits behaviors from: |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
L |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 SCENARIOS |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
This package supports the following scenarios: |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 extends |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
# given: synopsis |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
package Person; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
use Data::Object::Class; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
extends 'Identity'; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
package main; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
my $person = Person->new; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
This package supports the C keyword, which is used to declare |
75
|
|
|
|
|
|
|
superclasses your class will inherit from. See L for more information. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 has |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
# given: synopsis |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
package Person; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
use Data::Object::Class; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
has name => ( |
88
|
|
|
|
|
|
|
is => 'ro' |
89
|
|
|
|
|
|
|
); |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
package main; |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
my $person = Person->new(name => '...'); |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
This package supports the C keyword, which is used to declare class |
96
|
|
|
|
|
|
|
attributes, which can be accessed and assigned to using the built-in |
97
|
|
|
|
|
|
|
getter/setter or by the object constructor. See L for more information. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head2 with |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
# given: synopsis |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
package Employable; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
use Moo::Role; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
package Person; |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
use Data::Object::Class; |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
with 'Employable'; |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
package main; |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
my $person = Person->new; |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
This package supports the C keyword, which is used to declare roles to be |
120
|
|
|
|
|
|
|
used and compose into your class. See L for more information. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=cut |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head1 AUTHOR |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Al Newkirk, C |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 LICENSE |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Copyright (C) 2011-2019, Al Newkirk, et al. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under the terms |
133
|
|
|
|
|
|
|
of the The Apache License, Version 2.0, as elucidated in the L<"license |
134
|
|
|
|
|
|
|
file"|https://github.com/iamalnewkirk/data-object-class/blob/master/LICENSE>. |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head1 PROJECT |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
L |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
L |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
L |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
L |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
L |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
L |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=cut |