line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package BioX::Workflow::Command::run::Rules::Directives::Types::Stash; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
794
|
use Moose::Role; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
11
|
|
4
|
1
|
|
|
1
|
|
8416
|
use namespace::autoclean; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
13
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
306
|
use Data::Merger qw(merger); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head2 stash |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
This isn't ever used in the code. Its just there incase you want to persist objects across rules |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
It uses Moose::Meta::Attribute::Native::Trait::Hash and supports all the methods. |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
set_stash => 'set', |
15
|
|
|
|
|
|
|
get_stash => 'get', |
16
|
|
|
|
|
|
|
has_no_stash => 'is_empty', |
17
|
|
|
|
|
|
|
num_stashs => 'count', |
18
|
|
|
|
|
|
|
delete_stash => 'delete', |
19
|
|
|
|
|
|
|
stash_pairs => 'kv', |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has 'stash' => ( |
24
|
|
|
|
|
|
|
is => 'rw', |
25
|
|
|
|
|
|
|
isa => 'HashRef', |
26
|
|
|
|
|
|
|
traits => ['Hash'], |
27
|
|
|
|
|
|
|
default => sub { {} }, |
28
|
|
|
|
|
|
|
handles => { |
29
|
|
|
|
|
|
|
set_stash => 'set', |
30
|
|
|
|
|
|
|
get_stash => 'get', |
31
|
|
|
|
|
|
|
has_no_stash => 'is_empty', |
32
|
|
|
|
|
|
|
num_stashs => 'count', |
33
|
|
|
|
|
|
|
delete_stash => 'delete', |
34
|
|
|
|
|
|
|
stash_pairs => 'kv', |
35
|
|
|
|
|
|
|
}, |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub merge_stash { |
39
|
|
|
|
|
|
|
my $self = shift; |
40
|
|
|
|
|
|
|
my $target = shift; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my $merged_data = merger( $target, $self->stash ); |
43
|
|
|
|
|
|
|
$self->stash($merged_data); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |