| 1 | 15 | ▶ | use MooseX::Declare; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | |||
| 3 | class CatalystX::Declare::Keyword::Role | ||
| 4 | 15 | ▶ | extends MooseX::Declare::Syntax::Keyword::Role { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | |||
| 7 | 15 | ▶ | use aliased 'MooseX::MethodAttributes::Role::Meta::Role'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 15 | ▶ | use aliased 'MooseX::Role::Parameterized::Meta::Role::Parameterizable'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | use aliased 'CatalystX::Declare::Keyword::Action', 'ActionKeyword'; | ||
| 10 | |||
| 11 | |||
| 12 | around import_symbols_from (Object $ctx) { | ||
| 13 | |||
| 14 | $ctx->has_parameter_signature | ||
| 15 | ? $self->$orig($ctx) | ||
| 16 | : sprintf('Moose::Role -traits => q(MethodAttributes),') | ||
| 17 | } | ||
| 18 | |||
| 19 | before add_namespace_customizations (Object $ctx, Str $package) { | ||
| 20 | |||
| 21 | my $source = $self->import_symbols_from($ctx); | ||
| 22 | my @symbols = $self->imported_moose_symbols; | ||
| 23 | |||
| 24 | $ctx->add_preamble_code_parts( | ||
| 25 | 'use CLASS', | ||
| 26 | ); | ||
| 27 | } | ||
| 28 | |||
| 29 | after add_namespace_customizations (Object $ctx, Str $package) { | ||
| 30 | |||
| 31 | $ctx->add_preamble_code_parts( | ||
| 32 | sprintf( | ||
| 33 | 'use %s -traits => q(%s), qw( has )', | ||
| 34 | 'MooseX::Role::Parameterized', | ||
| 35 | 'MooseX::MethodAttributes::Role::Meta::Role', | ||
| 36 | ), | ||
| 37 | ) if $ctx->has_parameter_signature; | ||
| 38 | } | ||
| 39 | |||
| 40 | around default_inner (@args) { | ||
| 41 | |||
| 42 | return [ | ||
| 43 | @{ $self->$orig(@args) }, | ||
| 44 | ActionKeyword->new(identifier => 'action'), | ||
| 45 | ActionKeyword->new(identifier => 'under'), | ||
| 46 | ActionKeyword->new(identifier => 'final'), | ||
| 47 | ]; | ||
| 48 | } | ||
| 49 | } | ||
| 50 | |||
| 51 | __END__ | ||