Commit | Line | Data |
---|---|---|
087c79b5 | 1 | package ExampleMooRoleWithAttribute;; |
2 | use Moo::Role; | |
3 | # Note that autoclean here is the key bit! | |
6c49212f | 4 | # It causes the metaclass to be loaded and used before the 'has' fires |
5 | # so Moo needs to blow it away again at that point so the attribute gets | |
6 | # added | |
087c79b5 | 7 | use namespace::autoclean; |
8 | ||
9 | has output_to => ( | |
10 | is => 'ro', | |
11 | required => 1, | |
12 | ); | |
13 | ||
14 | 1; | |
15 |