Porf/examples/Person.pm untested

filter: Statementstmt 0.0% 0 / 31 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 11 totaltotal 0.0% 0 / 60 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
set_count
2.0
get_count
2.0
CRAP 2.0
1 # perl
2 #
3 # Person example class
4 #
5 # PORF Perl Open Report Framework
6 #
7 # Ralf Peine, Wed May 14 10:39:48 2014
8 #
9 #------------------------------------------------------------------------------
10  
11 use warnings;
12 use strict;
13  
14 package Report::Porf::examples::Person;
15  
16 # --- create Instance -----------------
17 sub new
18 {
19 my $caller = $_[0];
20 my $class = ref($caller) || $caller;
21
22 # let the class go
23 my $self = {};
24 bless $self, $class;
25  
26 return $self;
27 }
28  
29 #--------------------------------------------------------------------------------
30 #
31 # Attributes
32 #
33 #--------------------------------------------------------------------------------
34  
35 # --- Count ---------------------------------------------------------------------
36  
37 sub set_count {
38 my ($self, # instance_ref
39 $value # value to set
40 ) = @_;
41  
42 $self->{Count} = $value;
43 }
44  
45 sub get_count {
46 my ($self, # instance_ref
47 ) = @_;
48
49 return $self->{Count};
50 }
51  
52 # --- Prename -------------------------------------------------------------------
53  
54 sub set_prename {
55 my ($self, # instance_ref
56 $value # value to set
57 ) = @_;
58  
59 $self->{Prename} = $value;
60 }
61  
62 sub get_prename {
63 my ($self, # instance_ref
64 ) = @_;
65
66 return $self->{Prename};
67 }
68  
69 # --- Surname -------------------------------------------------------------------
70  
71 sub set_surname {
72 my ($self, # instance_ref
73 $value # value to set
74 ) = @_;
75  
76 $self->{Surname} = $value;
77 }
78  
79 sub get_surname {
80 my ($self, # instance_ref
81 ) = @_;
82
83 return $self->{Surname};
84 }
85  
86 # --- Age -----------------------------------------------------------------------
87  
88 sub set_age {
89 my ($self, # instance_ref
90 $value # value to set
91 ) = @_;
92  
93 $self->{Age} = $value;
94 }
95  
96 sub get_age {
97 my ($self, # instance_ref
98 ) = @_;
99
100 return $self->{Age};
101 }
102  
103 # --- Time ----------------------------------------------------------------------
104  
105 sub set_time {
106 my ($self, # instance_ref
107 $value # value to set
108 ) = @_;
109  
110 $self->{Time} = $value;
111 }
112  
113 sub get_time {
114 my ($self, # instance_ref
115 ) = @_;
116
117 return $self->{Time};
118 }
119  
120 =head1 NAME
121  
122 Report::Porf::examples::Person
123  
124 =head1 SYNOPSIS
125  
126 Data class.
127  
128 Only needed as example class for Porf examples.
129  
130 =head1 LICENSE AND COPYRIGHT
131  
132 Copyright (c) 2014 by Ralf Peine, Germany. All rights reserved.
133  
134 This library is free software; you can redistribute it and/or modify
135 it under the same terms as Perl itself, either Perl version 5.6.0 or,
136 at your option, any later version of Perl 5 you may have available.
137  
138 =head1 DISCLAIMER OF WARRANTY
139  
140 This library is distributed in the hope that it will be useful,
141 but without any warranty; without even the implied warranty of
142 merchantability or fitness for a particular purpose.
143  
144 =cut
145  
146 1;