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