File Coverage

blib/lib/Data/Object/Immutable.pm
Criterion Covered Total %
statement 20 20 100.0
branch 6 6 100.0
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 32 33 96.9


line stmt bran cond sub pod time code
1             # ABSTRACT: Immutable Data Type Objects for Perl 5
2             package Data::Object::Immutable;
3              
4 1     1   609 use 5.10.0;
  1         2  
  1         35  
5 1     1   5 use strict;
  1         0  
  1         30  
6 1     1   11 use warnings;
  1         1  
  1         27  
7              
8 1     1   486 use Data::Object;
  1         1856  
  1         42  
9 1     1   471 use Readonly;
  1         2413  
  1         124  
10              
11             our $VERSION = '0.04'; # VERSION
12              
13             sub new {
14 5     5 0 7218 my $self = Data::Object->new($_[1]);
15              
16 5 100       121367 Readonly::Hash %$self => %$self if UNIVERSAL::isa($self, 'HASH');
17 5 100       160 Readonly::Array @$self => @$self if UNIVERSAL::isa($self, 'ARRAY');
18 5 100       154 Readonly::Scalar $$self => $$self if UNIVERSAL::isa($self, 'SCALAR');
19              
20 5         85 return $self;
21             }
22              
23             1;
24              
25             __END__