Strip/System.pm untested

filter: Statementstmt 0.0% 0 / 25 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 38 CC 3 SCAR 17.5
CC
3
Cov
0%
new
12.0
get_id
2.0
get_name
2.0
CRAP 5.8
1 package Palm::Zetetic::Strip::System;
2  
3 use strict;
4  
5 use vars qw(@ISA $VERSION);
6  
7 require Exporter;
8  
9 @ISA = qw(Palm::Raw);
10 $VERSION = "1.02";
11  
12 =head1 NAME
13  
14 Palm::Zetetic::Strip::System - An immutable system object
15  
16 =head1 SYNOPSIS
17  
18 use Palm::Zetetic::Strip;
19  
20 # Create and load a new Palm::Zetetic::Strip object
21  
22 @systems = $strip->get_systems()
23 $id = $systems[0]->get_id();
24 $name = $systems[0]->get_name();
25  
26 =head1 DESCRIPTION
27  
28 This is an immutable data object that represents a system. A
29 Palm::Zetetic::Strip(3) object is a factory for system objects.
30  
31 =head1 METHODS
32  
33 =cut
34  
35 sub new
36 {
37 my $class = shift;
38 my (%args) = @_;
39 my $self = {};
40  
41 bless $self, $class;
42 $self->{id} = "";
43 $self->{name} = "";
44  
45 $self->{id} = $args{id} if defined($args{id});
46 $self->{name} = $args{name} if defined($args{name});
47 return $self;
48 }
49  
50 =head2 get_id
51  
52 $id = $system->get_id();
53  
54 Returns the ID of this system.
55  
56 =cut
57  
58 sub get_id
59 {
60 my ($self) = @_;
61 return $self->{id};
62 }
63  
64 =head2 get_name
65  
66 $name = $system->get_name();
67  
68 Returns the string name of this system;
69  
70 =cut
71  
72 sub get_name
73 {
74 my ($self) = @_;
75 return $self->{name};
76 }
77  
78 1;
79  
80 __END__