line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TablesRole::Util::Basic; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY |
4
|
|
|
|
|
|
|
our $DATE = '2020-11-04'; # DATE |
5
|
|
|
|
|
|
|
our $DIST = 'TablesRoles-Standard'; # DIST |
6
|
|
|
|
|
|
|
our $VERSION = '0.004'; # VERSION |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# enabled by Role::Tiny |
9
|
|
|
|
|
|
|
#use strict; |
10
|
|
|
|
|
|
|
#use warnings; |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
510
|
use Role::Tiny; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
requires 'get_row_arrayref'; |
15
|
|
|
|
|
|
|
requires 'get_row_hashref'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub as_aoa { |
18
|
1
|
|
|
1
|
1
|
1438
|
my $self = shift; |
19
|
1
|
|
|
|
|
7
|
$self->reset_iterator; |
20
|
1
|
|
|
|
|
2
|
my @aoa; |
21
|
1
|
|
|
|
|
5
|
while (my $row = $self->get_row_arrayref) { |
22
|
5
|
|
|
|
|
14
|
push @aoa, $row; |
23
|
|
|
|
|
|
|
} |
24
|
1
|
|
|
|
|
11
|
\@aoa; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub as_aoh { |
28
|
1
|
|
|
1
|
1
|
3074
|
my $self = shift; |
29
|
1
|
|
|
|
|
4
|
$self->reset_iterator; |
30
|
1
|
|
|
|
|
2
|
my @aoh; |
31
|
1
|
|
|
|
|
7
|
while (my $row = $self->get_row_hashref) { |
32
|
5
|
|
|
|
|
22
|
push @aoh, $row; |
33
|
|
|
|
|
|
|
} |
34
|
1
|
|
|
|
|
3
|
\@aoh; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
# ABSTRACT: Provide utility methods |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |