File Coverage

blib/lib/Data/Object/Universal.pm
Criterion Covered Total %
statement 12 17 70.5
branch 0 4 0.0
condition 0 6 0.0
subroutine 4 5 80.0
pod 0 1 0.0
total 16 33 48.4


line stmt bran cond sub pod time code
1             # ABSTRACT: A Universal Object for Perl 5
2             package Data::Object::Universal;
3              
4 1     1   554 use 5.10.0;
  1         3  
  1         105  
5              
6 1     1   490 use Moo 'with';
  1         13084  
  1         7  
7 1     1   1339 use Scalar::Util 'blessed';
  1         1  
  1         66  
8 1     1   688 use Types::Standard 'Any';
  1         55261  
  1         11  
9              
10             with 'Data::Object::Role::Universal';
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 = Any->($data)
20             unless blessed($data) && $data->isa($class);
21              
22 0 0         return bless ref($data) ? $data : \$data, $class;
23             }
24              
25             1;
26              
27             __END__