line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::Business::DK::FI; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
94180
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
129
|
|
4
|
4
|
|
|
4
|
|
18
|
use warnings; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
141
|
|
5
|
4
|
|
|
4
|
|
2564
|
use Class::InsideOut qw( private register id ); |
|
4
|
|
|
|
|
28615
|
|
|
4
|
|
|
|
|
782
|
|
6
|
4
|
|
|
4
|
|
501
|
use Carp qw(croak); |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
196
|
|
7
|
4
|
|
|
4
|
|
1224
|
use English qw(-no_match_vars); |
|
4
|
|
|
|
|
8904
|
|
|
4
|
|
|
|
|
27
|
|
8
|
4
|
|
|
4
|
|
4027
|
use Try::Tiny; |
|
4
|
|
|
|
|
6409
|
|
|
4
|
|
|
|
|
260
|
|
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
2022
|
use Business::DK::FI qw(validateFI); |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
1209
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.08'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
private number => my %number; # read-only accessor: number() |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub new { |
17
|
6
|
|
|
6
|
1
|
101
|
my ( $class, $number ) = @_; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
## no critic (Variables::ProhibitUnusedVariables) |
20
|
6
|
|
|
|
|
11
|
my $self = \( my $scalar ); |
21
|
|
|
|
|
|
|
|
22
|
6
|
|
|
|
|
12
|
bless $self, $class; |
23
|
|
|
|
|
|
|
|
24
|
6
|
|
|
|
|
29
|
register($self); |
25
|
|
|
|
|
|
|
|
26
|
6
|
100
|
|
|
|
124
|
if ($number) { |
27
|
5
|
|
|
|
|
20
|
$self->set_number($number); |
28
|
|
|
|
|
|
|
} else { |
29
|
1
|
|
|
|
|
15
|
croak 'You must provide a FI number'; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
4
|
|
|
|
|
16
|
return $self; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
## no critic (Subroutines::RequireFinalReturn) |
36
|
1
|
|
|
1
|
1
|
10
|
sub number { $number{ id $_[0] } } |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
1
|
1
|
15
|
sub get_number { $number{ id $_[0] } } |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub set_number { |
41
|
8
|
|
|
8
|
1
|
63
|
my ( $self, $unvalidated_fi ) = @_; |
42
|
|
|
|
|
|
|
|
43
|
8
|
|
|
|
|
15
|
my $rv = 0; |
44
|
|
|
|
|
|
|
|
45
|
8
|
100
|
|
|
|
17
|
if ($unvalidated_fi) { |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
try { |
48
|
7
|
|
|
7
|
|
320
|
$rv = validateFI($unvalidated_fi); |
49
|
|
|
|
|
|
|
|
50
|
5
|
50
|
|
|
|
22
|
if ( $rv == 0 ) { |
51
|
0
|
|
|
|
|
0
|
croak; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
catch { |
55
|
2
|
|
|
2
|
|
2052
|
croak 'Invalid FI number parameter'; |
56
|
7
|
|
|
|
|
47
|
}; |
57
|
|
|
|
|
|
|
|
58
|
5
|
|
|
|
|
92
|
$number{ id $self } = $unvalidated_fi; |
59
|
|
|
|
|
|
|
|
60
|
5
|
|
|
|
|
16
|
return $rv; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
} else { |
63
|
1
|
|
|
|
|
24
|
croak 'You must provide a FI number'; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
__END__ |