| 1 | # | ||
| 2 | # This file is part of App-Magpie | ||
| 3 | # | ||
| 4 | # This software is copyright (c) 2011 by Jerome Quelin. | ||
| 5 | # | ||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||
| 8 | # | ||
| 9 | 1 | ▶ | use 5.012; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | package App::Magpie::Action::Old::Set; | ||
| 14 | # ABSTRACT: a set of AM::Old::Modules objects | ||
| 15 | 1 | $App::Magpie::Action::Old::Set::VERSION = '2.010'; | |
| 16 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | 1 | ▶ | use MooseX::Has::Sugar; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | |||
| 19 | |||
| 20 | # -- public attributes | ||
| 21 | |||
| 22 | |||
| 23 | 1 | has name => ( ro, isa=>"Str", required ); | |
| 24 | |||
| 25 | |||
| 26 | has _modules => ( | ||
| 27 | ro, | ||
| 28 | traits => ['Array'], | ||
| 29 | isa => 'ArrayRef[App::Magpie::Action::Old::Module]', | ||
| 30 | 0 | ▶ | default => sub { [] }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 31 | 1 | handles => { | |
| 32 | all_modules => 'elements', | ||
| 33 | add_module => 'push', | ||
| 34 | nb_modules => 'count', | ||
| 35 | }, | ||
| 36 | ); | ||
| 37 | |||
| 38 | #-- | ||
| 39 | |||
| 40 | |||
| 41 | 0 | ▶ | sub nb_packages { |
|
Subroutine
nb_packages: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 42 | 0 | my $self = shift; | |
| 43 | 0 | my %seen; | |
| 44 | @seen{ | ||
| 45 | 0 | map { $_->packages->[0] } | |
| 46 | $self->all_modules | ||
| 47 | }++; | ||
| 48 | 0 | return scalar keys %seen; | |
| 49 | } | ||
| 50 | |||
| 51 | |||
| 52 | 1 | 1; | |
| 53 | |||
| 54 | __END__ | ||