Created
June 29, 2011 14:31
-
-
Save berekuk/1053942 to your computer and use it in GitHub Desktop.
requires-vs-attribute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package My::Role::Owned; | |
| use Moose::Role; | |
| requires 'owner'; | |
| package My::Role::Owned::FromFile; | |
| use Moose::Role; | |
| with 'My::Role::Owned'; | |
| has 'owner' => ( | |
| is => 'ro', | |
| builder => '_build_owner', | |
| ); | |
| has 'file' => ( | |
| is => 'ro', | |
| required => 1, | |
| ); | |
| sub _build_owner { | |
| ... # detect owner from file owner | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment