File Coverage

blib/lib/Tie/Array/ArrayData.pm
Criterion Covered Total %
statement 8 32 25.0
branch 0 2 0.0
condition n/a
subroutine 3 13 23.0
pod n/a
total 11 47 23.4


line stmt bran cond sub pod time code
1             package Tie::Array::ArrayData;
2              
3 1     1   281065 use 5.010001;
  1         3  
4 1     1   9 use strict;
  1         2  
  1         44  
5 1     1   17 use warnings;
  1         2  
  1         322  
6              
7             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
8             our $DATE = '2024-01-15'; # DATE
9             our $DIST = 'Tie-Array-ArrayData'; # DIST
10             our $VERSION = '0.001'; # VERSION
11              
12             sub TIEARRAY {
13 0     0     require Module::Load::Util;
14              
15 0           my $class = shift;
16 0           my $arraydata = @_;
17              
18 0 0         die "Please specify an ArrayData module to instantiate (string or 2-element array)" unless $arraydata;
19 0           my $adobj = Module::Load::Util::instantiate_class_with_optional_args({ns_prefix=>"ArrayData"}, $arraydata);
20              
21 0           return bless {
22             _adobj => $adobj,
23             }, $class;
24             }
25              
26             sub FETCH {
27 0     0     my ($self, $index) = @_;
28 0           $self->{_adobj}->get_item_at_pos($index);
29             }
30              
31             sub STORE {
32 0     0     my ($self, $index, $value) = @_;
33 0           die "Not supported";
34             }
35              
36             sub FETCHSIZE {
37 0     0     my $self = shift;
38 0           $self->{_adobj}->get_item_count;
39             }
40              
41             sub STORESIZE {
42 0     0     my ($self, $count) = @_;
43 0           die "Not supported";
44             }
45              
46             # sub EXTEND this, count
47              
48             # sub EXISTS this, key
49              
50             # sub DELETE this, key
51              
52             sub PUSH {
53 0     0     my $self = shift;
54 0           die "Not supported";
55             }
56              
57             sub POP {
58 0     0     my $self = shift;
59 0           die "Not supported";
60             }
61              
62             sub UNSHIFT {
63 0     0     my $self = shift;
64 0           die "Not supported";
65             }
66              
67             sub SHIFT {
68 0     0     my $self = shift;
69 0           die "Not supported";
70             }
71              
72             sub SPLICE {
73 0     0     my $self = shift;
74 0           die "Not supported";
75             }
76              
77             1;
78             # ABSTRACT: Access ArrayData object as a tied array
79              
80             __END__