| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Business::CompanyDesignator::Record; |
|
2
|
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
61
|
use Moose; |
|
|
9
|
|
|
|
|
19
|
|
|
|
9
|
|
|
|
|
77
|
|
|
4
|
9
|
|
|
9
|
|
56314
|
use utf8; |
|
|
9
|
|
|
|
|
20
|
|
|
|
9
|
|
|
|
|
60
|
|
|
5
|
9
|
|
|
9
|
|
314
|
use warnings qw(FATAL utf8); |
|
|
9
|
|
|
|
|
20
|
|
|
|
9
|
|
|
|
|
384
|
|
|
6
|
9
|
|
|
9
|
|
46
|
use Carp; |
|
|
9
|
|
|
|
|
16
|
|
|
|
9
|
|
|
|
|
520
|
|
|
7
|
9
|
|
|
9
|
|
4813
|
use namespace::autoclean; |
|
|
9
|
|
|
|
|
65051
|
|
|
|
9
|
|
|
|
|
49
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has 'long' => ( is => 'ro', isa => 'Str', required => 1 ); |
|
10
|
|
|
|
|
|
|
has 'record' => ( is => 'ro', isa => 'HashRef', required => 1 ); |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has [qw(abbr1 lang)] => ( is => 'ro', lazy_build => 1 ); |
|
13
|
|
|
|
|
|
|
has 'abbr' => ( is => 'ro', isa => 'ArrayRef[Str]', lazy => 1, builder => '_build_abbr', |
|
14
|
|
|
|
|
|
|
reader => '_abbr', traits => [ qw(Array) ], handles => { abbr => 'elements' } ); |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _build_abbr { |
|
17
|
634
|
|
|
634
|
|
943
|
my $self = shift; |
|
18
|
634
|
|
|
|
|
17299
|
my $abbr_std = $self->record->{abbr_std}; |
|
19
|
634
|
|
100
|
|
|
16131
|
my $abbr = $self->record->{abbr} || []; |
|
20
|
634
|
100
|
|
|
|
1548
|
$abbr = [ $abbr ] if ! ref $abbr; |
|
21
|
634
|
100
|
|
|
|
1217
|
push @$abbr, $abbr_std if $abbr_std; |
|
22
|
634
|
|
|
|
|
19766
|
return $abbr; |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _build_abbr1 { |
|
26
|
634
|
|
|
634
|
|
1030
|
my $self = shift; |
|
27
|
634
|
|
|
|
|
21202
|
my @abbr = $self->abbr; |
|
28
|
634
|
100
|
|
|
|
2155
|
if (@abbr) { |
|
29
|
622
|
|
|
|
|
16649
|
return $abbr[0]; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub _build_lang { |
|
34
|
866
|
|
|
866
|
|
1499
|
my $self = shift; |
|
35
|
866
|
|
|
|
|
24080
|
$self->record->{lang}; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 NAME |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Business::CompanyDesignator::Record - class for modelling individual L<Business::CompanyDesignator> input records |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# Typically instantiated via Business::CompanyDesignator->record() or records() |
|
49
|
|
|
|
|
|
|
use Business::CompanyDesignator; |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
$bcd = Business::CompanyDesignator->new; |
|
52
|
|
|
|
|
|
|
$record = $bcd->record("Limited"); |
|
53
|
|
|
|
|
|
|
@records = $bcd->records("Inc."); |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# Accessors |
|
56
|
|
|
|
|
|
|
$long = $record->long; |
|
57
|
|
|
|
|
|
|
@abbr = $record->abbr; |
|
58
|
|
|
|
|
|
|
$abbr1 = $record->abbr1; |
|
59
|
|
|
|
|
|
|
$lang = $record->lang; |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 METHODS |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 new() |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Create a new Business::CompanyDesignator::Record object. |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
B<Note:> objects are normally instantiated via Business::CompanyDesignator->record() |
|
68
|
|
|
|
|
|
|
or records(), however: |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
use Business::CompanyDesignator; |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
$bcd = Business::CompanyDesignator->new; |
|
73
|
|
|
|
|
|
|
$record = $bcd->record("Limited"); |
|
74
|
|
|
|
|
|
|
@records = $bcd->records("Inc."); |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head2 long() |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Returns the record's long designator (a string). |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
$long = $record->long; |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 abbr() |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Returns a list of the abbreviations associated with this record (if any). |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
@abbr = $record->abbr; |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 abbr1() |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Returns the first abbreviation associated with this record (a string, if any). |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
$abbr1 = $record->abbr1; |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 lang() |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Returns the ISO-639 language code associated with this record (a string). |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
$lang = $record->lang; |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 AUTHOR |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Gavin Carr <gavin@profound.net> |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Copyright (C) 2013-2015 Gavin Carr |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it |
|
109
|
|
|
|
|
|
|
under the same terms as Perl itself. |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=cut |
|
112
|
|
|
|
|
|
|
|