File Coverage

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


line stmt bran cond sub pod time code
1             # ABSTRACT: An Undef Object for Perl 5
2             package Data::Object::Undef;
3              
4 1     1   594 use 5.10.0;
  1         3  
  1         46  
5              
6 1     1   493 use Moo 'with';
  1         13088  
  1         5  
7 1     1   1299 use Scalar::Util 'blessed';
  1         1  
  1         76  
8 1     1   596 use Types::Standard 'Undef';
  1         57957  
  1         11  
9              
10             with 'Data::Object::Role::Undef';
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 = Undef->($data)
20             unless blessed($data) && $data->isa($class);
21              
22 0           return bless \$data, $class;
23             }
24              
25             1;
26              
27             __END__