Transform/Extensions.pm

filter: Statementstmt 82.8% 29 / 35 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 77.7% 7 / 9 Podpod 0.0% 0 / 3 totaltotal 76.6% 36 / 47 CC 1 SCAR 2.0
CC
1
Cov
83%
KeyFromIndex
2.0
ValueFromIndex
2.0
BEGIN
1.0
CRAP 1.2
« Transform.pm ↑ Summary Transform/Closures.pm »
1 package Date::Transform::Extensions;
2
3 1 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 1 ▶use Tie::IxHash;
Subroutine BEGIN: called CC=1 SCAR=0.0
9
10 1 require Exporter;
11 1 ▶use AutoLoader qw(AUTOLOAD);
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 our @ISA = qw( Exporter );
13
14 # Items to export into callers namespace by default. Note: do not export
15 # names by default without a very good reason. Use EXPORT_OK instead.
16 # Do not simply export all your public functions/methods/constants.
17
18 # This allows declaration use Date::Manip::Transform ':all';
19 # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
20 # will save memory.
21 1 our %EXPORT_TAGS = (
22 'all' => [
23 qw( Tie::IxHash::IndexFromKey Tie::IxHash::KeyFromIndex Tie::IxHash::ValueFromIndex )
24 ]
25 );
26 1 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
27
28 1 our @EXPORT =
29 qw( Tie::IxHash::IndexFromKey Tie::IxHash::KeyFromIndex Tie::IxHash::ValueFromIndex);
30
31 1 our $VERSION = '0.11';
32
33 # Preloaded methods go here.
34
35 ## SUBROUTINE: Tie::IxHash::IndexFromKey
36 ## Usage: ixhash_obj->IndexFromKey $key ) => $Index
37 ## Returns the index(position) of the key ,$key
38 7 ▶sub Tie::IxHash::IndexFromKey {
Subroutine IndexFromKey: called CC=1 SCAR=0.0
Pod undocumented
39
40 7 my $self = shift;
41 7 my $key = shift;
42
43 7 my @indices = $self->Indices($key);
44
45 7 return $indices[0];
46
47 } # END SUBROUTINE: Tie::IxHash::Index
48
49 ## SUBROUTINE: Tie::IxHash::KeyFromIndex
50 ## Usage: $ixhash_obj->KeyFromIndex( $Index ) = $key
51 ##
52 0 ▶sub Tie::IxHash::KeyFromIndex {
Subroutine KeyFromIndex: not called CC=1 SCAR=6.9
Pod undocumented
53
54 0 my $self = shift;
55 0 my $index = shift;
56
57 0 return $self->[1]->[$index];
58
59 } # END SUBROUTINE: tie::IxHash::KeyFromIndex
60
61 ## SUBROUTINE: Tie::IxHash::ValueFromIndex
62 0 ▶sub Tie::IxHash::ValueFromIndex {
Subroutine ValueFromIndex: not called CC=1 SCAR=6.9
Pod undocumented
63
64 0 my $self = shift;
65 0 my $index = shift;
66
67 0 return $self->FETCH( $self->[1]->[$index] );
68
69 } # END SUBROUTINE: Tie::IxHash::ValueFromIndex
70
71 ########
72
73 1 1;
74
75 __END__;
« Transform.pm ↑ Summary Transform/Closures.pm »