File Coverage

blib/lib/List/Objects/WithUtils/Role/Array/TiedRO.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package List::Objects::WithUtils::Role::Array::TiedRO;
2             $List::Objects::WithUtils::Role::Array::TiedRO::VERSION = '2.027002';
3 3     3   2465 use strictures 2;
  3         27  
  3         206  
4 3     3   773 use Carp ();
  3         7  
  3         61  
5              
6             # This role can be applied to the objects backing tied arrays
7             # after construction time in order to swap a mutable tied array
8             # for an immutable implementation;
9             # Array::Immutable::Typed::immarray_of does this in order to retain
10             # normal tied type array behavior until construction is complete.
11              
12 3     3   16 use Role::Tiny;
  3         7  
  3         19  
13              
14             around $_ => sub {
15             Carp::croak "Attempted to modify a read-only value"
16             } for qw/
17             STORE
18             STORESIZE
19             CLEAR
20             PUSH
21             POP
22             SHIFT
23             SPLICE
24             UNSHIFT
25             EXTEND
26             /;
27              
28             1;