blib/lib/MooseX/Role/Callback/Meta/Trait.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 1 | 3 | 33.3 |
branch | n/a | ||
condition | n/a | ||
subroutine | 1 | 1 | 100.0 |
pod | n/a | ||
total | 2 | 4 | 50.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package MooseX::Role::Callback::Meta::Trait; | ||||||
2 | |||||||
3 | our $VERSION = '0.01'; | ||||||
4 | |||||||
5 | 1 | 1 | 1784 | use Moose::Role; | |||
0 | |||||||
0 | |||||||
6 | |||||||
7 | has include_callbacks => ( | ||||||
8 | is => 'ro', | ||||||
9 | isa => 'ArrayRef[CodeRef]', | ||||||
10 | default => sub { [] }, | ||||||
11 | ); | ||||||
12 | |||||||
13 | before 'apply' => sub { | ||||||
14 | my ( $meta, $thing ) = @_; | ||||||
15 | $_->( $meta, $thing ) for @{ $meta->include_callbacks }; | ||||||
16 | |||||||
17 | return; | ||||||
18 | }; | ||||||
19 | |||||||
20 | 1; |