Package/Relationship.pm untested

filter: Statementstmt 0.0% 0 / 24 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 39 CC 3 SCAR 12.8
CC
3
Cov
0%
get_name
6.0
get_range
6.0
new
2.0
CRAP 3.6
1 # $Id$
2 package Youri::Package::Relationship;
3  
4 =head1 NAME
5  
6 Youri::Package::Relationship - Package relationship class
7  
8 =head1 DESCRIPTION
9  
10 This class represent a relationship from the package owning it to another
11 package.
12  
13 =cut
14  
15 use strict;
16 use warnings;
17 use Carp;
18  
19 use constant NAME => 0;
20 use constant RANGE => 1;
21  
22 =head1 CLASS METHODS
23  
24 =head2 new(%args)
25  
26 Creates and returns a new Youri::Package::Relationship object.
27  
28 =cut
29  
30 sub new {
31 my ($class, $name, $range) = @_;
32  
33 return bless [
34 $name,
35 $range
36 ], $class;
37 }
38  
39 =head2 get_name()
40  
41 Returns the name of the package this relationship applies to.
42  
43 =cut
44  
45 sub get_name {
46 my ($self) = @_;
47 croak "Not a class method" unless ref $self;
48  
49 return $self->[NAME];
50 }
51  
52 =head2 get_range()
53  
54 Returns the revision range for which this relationship applies.
55  
56 =cut
57  
58 sub get_range {
59 my ($self) = @_;
60 croak "Not a class method" unless ref $self;
61  
62 return $self->[RANGE];
63 }
64  
65 1;