| 1 | # | ||
| 2 | # This file is part of MooseX-TrackDirty-Attributes | ||
| 3 | # | ||
| 4 | # This software is Copyright (c) 2011 by Chris Weyl. | ||
| 5 | # | ||
| 6 | # This is free software, licensed under: | ||
| 7 | # | ||
| 8 | # The GNU Lesser General Public License, Version 2.1, February 1999 | ||
| 9 | # | ||
| 10 | package MooseX::TrackDirty::Attributes::Trait::Role::Composite; | ||
| 11 | 4 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 4 | $MooseX::TrackDirty::Attributes::Trait::Role::Composite::AUTHORITY = 'cpan:RSRCHBOY'; | |
| 13 | } | ||
| 14 | 4 | $MooseX::TrackDirty::Attributes::Trait::Role::Composite::VERSION = '2.003'; | |
| 15 | # ABSTRACT: Apply our application::to* traits to any composition of our role and any other | ||
| 16 | |||
| 17 | 4 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | 4 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | |||
| 20 | 4 | ▶ | use MooseX::TrackDirty::Attributes::Util ':all'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | |||
| 22 | # debugging... | ||
| 23 | #use Smart::Comments; | ||
| 24 | |||
| 25 | |||
| 26 | 3 | ▶ | around apply_params => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 27 | 3 | my ($orig, $self) = (shift, shift); | |
| 28 | |||
| 29 | 3 | return Moose::Util::MetaRole::apply_metaroles( | |
| 30 | for => $self->$orig(@_), | ||
| 31 | role_metaroles => { | ||
| 32 | role => [ trait_for 'Role' ], | ||
| 33 | application_to_class => [ ToClass ], | ||
| 34 | application_to_role => [ ToRole ], | ||
| 35 | application_to_instance => [ ToInstance ], | ||
| 36 | }, | ||
| 37 | ); | ||
| 38 | 4 | }; | |
| 39 | |||
| 40 | |||
| 41 | 4 | !!42; | |
| 42 | |||
| 43 | __END__ | ||