Commit | Line | Data |
---|---|---|
58541c41 | 1 | package TestApp::Plugin::ParameterizedRole; |
2 | ||
3 | use MooseX::Role::Parameterized; | |
4 | use namespace::autoclean; | |
5 | ||
6 | parameter method_name => ( | |
7 | isa => 'Str', | |
8 | required => 1, | |
9 | ); | |
10 | ||
11 | role { | |
12 | my $p = shift; | |
13 | my $method_name = $p->method_name; | |
14 | ||
15 | method $method_name => sub { 'birne' }; | |
16 | }; | |
17 | ||
18 | 1; |