Created
July 29, 2013 12:44
-
-
Save ian-kent/6104066 to your computer and use it in GitHub Desktop.
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 MooseRole; | |
use Moose::Role; | |
sub dosomething { | |
my ($field, %args) = @_; | |
my $package = caller; | |
use Data::Dumper; | |
print Dumper $package->meta->get_attribute($field); | |
} | |
package MooseClass; | |
use Moose; | |
BEGIN { | |
with 'MooseRole'; | |
} | |
has 'something' => ( is => 'rw' ); | |
dosomething 'something' => ( a => 1, b => 2 ); | |
__PACKAGE__->meta->make_immutable; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment