blib/lib/BioX/Workflow/Command/run/Rules/Directives/Types/Hash.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 3 | 8 | 37.5 |
branch | n/a | ||
condition | n/a | ||
subroutine | 1 | 3 | 33.3 |
pod | 0 | 1 | 0.0 |
total | 4 | 12 | 33.3 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package BioX::Workflow::Command::run::Rules::Directives::Types::Hash; | ||||||
2 | |||||||
3 | 1 | 1 | 1592 | use Moose::Role; | |||
1 | 3 | ||||||
1 | 10 | ||||||
4 | |||||||
5 | sub create_HASH_attr { | ||||||
6 | 0 | 0 | 0 | my $self = shift; | |||
7 | 0 | my $meta = shift; | |||||
8 | 0 | my $k = shift; | |||||
9 | |||||||
10 | $meta->add_attribute( | ||||||
11 | $k => ( | ||||||
12 | traits => ['Hash'], | ||||||
13 | isa => 'HashRef', | ||||||
14 | is => 'rw', | ||||||
15 | clearer => "clear_$k", | ||||||
16 | 0 | 0 | default => sub { {} }, | ||||
17 | 0 | handles => { | |||||
18 | "get_$k" => 'get', | ||||||
19 | "has_no_$k" => 'is_empty', | ||||||
20 | "num_$k" => 'count', | ||||||
21 | "$k" . "_pairs" => 'kv', | ||||||
22 | }, | ||||||
23 | ) | ||||||
24 | ); | ||||||
25 | } | ||||||
26 | |||||||
27 | 1; |