File: ExampleMooRoleWithAttribute.pm

package info (click to toggle)
libmoo-perl 0.091011-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 476 kB
  • sloc: perl: 1,688; makefile: 4; sh: 1
file content (15 lines) | stat: -rw-r--r-- 337 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package ExampleMooRoleWithAttribute;;
use Moo::Role;
# Note that autoclean here is the key bit!
# It causes the metaclass to be loaded and used before the 'has' fires
# so Moo needs to blow it away again at that point so the attribute gets
# added
use namespace::autoclean;

has output_to => (
    is => 'ro',
    required => 1,
);

1;