« lib/BioX/Workflow/Command/run/Rules/Exceptions/KeyDeclaration.pm
↑ Summary
lib/BioX/Workflow/Command/new.pm »
| 1 | package BioX::Workflow::Command::run::Rules::Directives::Types::HPC; | ||
| 2 | |||
| 3 | 1 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | has 'HPC' => ( | ||
| 7 | is => 'rw', | ||
| 8 | isa => 'HashRef|ArrayRef', | ||
| 9 | 0 | ▶ | default => sub { {} } |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 10 | 1 | ); | |
| 11 | |||
| 12 | # after 'BUILD' => sub { | ||
| 13 | # my $self = shift; | ||
| 14 | # | ||
| 15 | # $self->set_register_types( | ||
| 16 | # 'HPC', | ||
| 17 | # { | ||
| 18 | # builder => 'create_hpc_attr', | ||
| 19 | # lookup => ['^HPC$'] | ||
| 20 | # } | ||
| 21 | # ); | ||
| 22 | # }; | ||
| 23 | # | ||
| 24 | # sub create_hpc_attr { | ||
| 25 | # my $self = shift; | ||
| 26 | # my $meta = shift; | ||
| 27 | # my $k = shift; | ||
| 28 | # my $v = shift; | ||
| 29 | # | ||
| 30 | # my $hpc_hash = $self->iter_hpc_array; | ||
| 31 | # $self->create_HASH_attr($meta, $k, $hpc_hash); | ||
| 32 | # | ||
| 33 | # $meta->add_attribute( | ||
| 34 | # $k => ( | ||
| 35 | # is => 'rw', | ||
| 36 | # lazy_build => 1, | ||
| 37 | # ) | ||
| 38 | # ); | ||
| 39 | # } | ||
| 40 | # | ||
| 41 | # ##TODO Transform all of these to hashes | ||
| 42 | # | ||
| 43 | # =head3 iter_hpc_array | ||
| 44 | # | ||
| 45 | # =cut | ||
| 46 | # | ||
| 47 | # sub iter_hpc_array { | ||
| 48 | # my $self = shift; | ||
| 49 | # my $hpc_values = shift; | ||
| 50 | # | ||
| 51 | # if ( ref($hpc_values) eq 'HASH' ) { | ||
| 52 | # return $hpc_values; | ||
| 53 | # } | ||
| 54 | # | ||
| 55 | # my $hpc_hash = {}; | ||
| 56 | # foreach my $href ( @{$aref} ) { | ||
| 57 | # if ( ref($href) eq 'HASH' ) { | ||
| 58 | # my @keys = keys %{$href}; | ||
| 59 | # map { $hpc_hash->{$_} = $href->{$_} } @keys; | ||
| 60 | # } | ||
| 61 | # else { | ||
| 62 | # $self->app_log->warn( | ||
| 63 | # 'You seem to be mixing and matching HPC types.'); | ||
| 64 | # return $hpc_values; | ||
| 65 | # } | ||
| 66 | # } | ||
| 67 | # | ||
| 68 | # return $hpc_hash; | ||
| 69 | # } | ||
| 70 | |||
| 71 | 1 | ▶ | no Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 72 | 1 | 1; | |