line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: A Hash Object for Perl 5 |
2
|
|
|
|
|
|
|
package Data::Object::Hash; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
517
|
use 5.10.0; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
1271
|
use Moo 'with'; |
|
1
|
|
|
|
|
14083
|
|
|
1
|
|
|
|
|
6
|
|
7
|
1
|
|
|
1
|
|
1140
|
use Scalar::Util 'blessed'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
70
|
|
8
|
1
|
|
|
1
|
|
586
|
use Types::Standard 'HashRef'; |
|
1
|
|
|
|
|
57057
|
|
|
1
|
|
|
|
|
14
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with 'Data::Object::Role::Hash'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.02'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
16
|
0
|
|
|
|
|
|
my $data = shift; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
0
|
|
|
|
$class = ref($class) || $class; |
19
|
0
|
0
|
0
|
|
|
|
$data = HashRef->($data) |
20
|
|
|
|
|
|
|
unless blessed($data) && $data->isa($class); |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
return bless $data, $class; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |