File Coverage

blib/lib/Objects/Collection/Item.pm
Criterion Covered Total %
statement 18 29 62.0
branch 0 2 0.0
condition 0 3 0.0
subroutine 6 10 60.0
pod 0 1 0.0
total 24 45 53.3


line stmt bran cond sub pod time code
1             package Objects::Collection::Item;
2              
3              
4             =head1 NAME
5              
6             Objects::Collection::Item - Base class for objects.
7              
8             =head1 SYNOPSIS
9              
10             use Objects::Collection::Item;
11             our @ISA = qw( Objects::Collection::Item );
12            
13             =head1 DESCRIPTION
14              
15             Base class for objects.
16              
17             =cut
18              
19 1     1   1926 use strict;
  1         2  
  1         36  
20 1     1   5 use warnings;
  1         1  
  1         24  
21 1     1   4 use strict;
  1         2  
  1         20  
22 1     1   5 use Carp;
  1         3  
  1         60  
23 1     1   5 use Data::Dumper;
  1         2  
  1         57  
24 1     1   6 use Objects::Collection::Base;
  1         2  
  1         328  
25             @Objects::Collection::Item::ISA = qw(Objects::Collection::Base);
26             $Objects::Collection::Item::VERSION = '0.02';
27             attributes(qw/ _attr/);
28 0     0 0   sub init { return 1 };#if suss
29             sub _init {
30 0     0     my $self = shift;
31 0           $self->_attr(shift);
32 0           return $self->init(@_);
33             }
34             sub _get_attr {
35 0     0     return $_[0]->_attr;
36             }
37             sub _changed {
38 0     0     my $self = shift;
39 0           my $rec = $self->_attr();
40 0 0 0       if (ref $rec eq 'HASH' and my $obj = tied %$rec ) {
41 0           return $obj->_changed;
42             } else {
43 0           carp ref($self)."Not tied _attr"
44             }
45 0           return 0
46             }
47             # Preloaded methods go here.
48              
49             1;
50             __END__