line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::Business::DK::FI; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
196913
|
use strict; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
171
|
|
4
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
149
|
|
5
|
4
|
|
|
4
|
|
8444
|
use Class::InsideOut qw( private register id ); |
|
4
|
|
|
|
|
44845
|
|
|
4
|
|
|
|
|
193
|
|
6
|
4
|
|
|
4
|
|
642
|
use Carp qw(croak); |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
198
|
|
7
|
4
|
|
|
4
|
|
1940
|
use English qw(-no_match_vars); |
|
4
|
|
|
|
|
10397
|
|
|
4
|
|
|
|
|
33
|
|
8
|
4
|
|
|
4
|
|
9906
|
use Try::Tiny; |
|
4
|
|
|
|
|
9373
|
|
|
4
|
|
|
|
|
548
|
|
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
3500
|
use Business::DK::FI qw(validateFI); |
|
4
|
|
|
|
|
17
|
|
|
4
|
|
|
|
|
2162
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.07'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
private number => my %number; # read-only accessor: number() |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub new { |
17
|
6
|
|
|
6
|
1
|
112
|
my ( $class, $number ) = @_; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
## no critic (Variables::ProhibitUnusedVariables) |
20
|
6
|
|
|
|
|
14
|
my $self = \( my $scalar ); |
21
|
|
|
|
|
|
|
|
22
|
6
|
|
|
|
|
16
|
bless $self, $class; |
23
|
|
|
|
|
|
|
|
24
|
6
|
|
|
|
|
33
|
register($self); |
25
|
|
|
|
|
|
|
|
26
|
6
|
100
|
|
|
|
102
|
if ($number) { |
27
|
5
|
|
|
|
|
24
|
$self->set_number($number); |
28
|
|
|
|
|
|
|
} else { |
29
|
1
|
|
|
|
|
21
|
croak 'You must provide a FI number'; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
4
|
|
|
|
|
18
|
return $self; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
## no critic (Subroutines::RequireFinalReturn) |
36
|
1
|
|
|
1
|
1
|
12
|
sub number { $number{ id $_[0] } } |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
1
|
1
|
22
|
sub get_number { $number{ id $_[0] } } |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub set_number { |
41
|
8
|
|
|
8
|
1
|
100
|
my ( $self, $unvalidated_fi ) = @_; |
42
|
|
|
|
|
|
|
|
43
|
8
|
|
|
|
|
14
|
my $rv = 0; |
44
|
|
|
|
|
|
|
|
45
|
8
|
100
|
|
|
|
21
|
if ($unvalidated_fi) { |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
try { |
48
|
7
|
|
|
7
|
|
480
|
$rv = validateFI($unvalidated_fi); |
49
|
|
|
|
|
|
|
|
50
|
5
|
50
|
|
|
|
39
|
if ( $rv == 0 ) { |
51
|
0
|
|
|
|
|
0
|
croak; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
catch { |
55
|
2
|
|
|
2
|
|
2528
|
croak 'Invalid FI number parameter'; |
56
|
7
|
|
|
|
|
71
|
}; |
57
|
|
|
|
|
|
|
|
58
|
5
|
|
|
|
|
103
|
$number{ id $self } = $unvalidated_fi; |
59
|
|
|
|
|
|
|
|
60
|
5
|
|
|
|
|
16
|
return $rv; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
} else { |
63
|
1
|
|
|
|
|
26
|
croak 'You must provide a FI number'; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
__END__ |