line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Flux::Simple::ArrayOut; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Flux::Simple::ArrayOut::VERSION = '1.03'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: output stream which stores data in a given array |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
6
|
|
|
6
|
|
28
|
use Moo; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
28
|
|
10
|
|
|
|
|
|
|
with 'Flux::Out'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has '_data' => ( |
13
|
|
|
|
|
|
|
is => 'ro', |
14
|
|
|
|
|
|
|
required => 1, |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub BUILDARGS { |
18
|
2
|
|
|
2
|
0
|
2336
|
my $class = shift; |
19
|
2
|
|
|
|
|
5
|
my ($data) = @_; |
20
|
2
|
|
|
|
|
49
|
return { _data => $data }; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub write { |
24
|
4
|
|
|
4
|
0
|
974
|
my $self = shift; |
25
|
4
|
|
|
|
|
7
|
my ($item) = @_; |
26
|
4
|
|
|
|
|
6
|
push @{ $self->_data }, $item; |
|
4
|
|
|
|
|
17
|
|
27
|
4
|
|
|
|
|
12
|
return; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub write_chunk { |
31
|
1
|
|
|
1
|
0
|
5
|
my $self = shift; |
32
|
1
|
|
|
|
|
2
|
my ($chunk) = @_; |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
|
|
2
|
push @{ $self->_data }, @$chunk; |
|
1
|
|
|
|
|
5
|
|
35
|
1
|
|
|
|
|
3
|
return; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
1
|
0
|
782
|
sub commit {} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |