diff options
author | Karen Etheridge <karen@etheridge.ca> | 2010-07-27 15:10:57 -0700 |
---|---|---|
committer | Karen Etheridge <karen@etheridge.ca> | 2010-07-27 17:49:11 -0700 |
commit | e307e391921ca301d84e6c57f569beb44d7dbb98 (patch) | |
tree | 2cd5eac0314557fde36987e8a6d8878608af976d /lib | |
parent | 7f427a8ad30aa6e29c92c080e7474b91b2f679fd (diff) | |
download | mx-alwayscoerce-e307e391921ca301d84e6c57f569beb44d7dbb98.tar.gz mx-alwayscoerce-e307e391921ca301d84e6c57f569beb44d7dbb98.zip |
update Moose::Exporter calls for post-0.93 Moose API (RT#59744)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/MooseX/AlwaysCoerce.pm | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/MooseX/AlwaysCoerce.pm b/lib/MooseX/AlwaysCoerce.pm index 3fbfd59..240dff5 100644 --- a/lib/MooseX/AlwaysCoerce.pm +++ b/lib/MooseX/AlwaysCoerce.pm @@ -81,22 +81,22 @@ Use C<< coerce => 0 >> to disable a coercion explicitly. }; } +my (undef, undef, $init_meta) = Moose::Exporter->build_import_methods( + install => [ qw(import unimport) ], + class_metaroles => { + attribute => ['MooseX::AlwaysCoerce::Role::Meta::Attribute'], + class => ['MooseX::AlwaysCoerce::Role::Meta::Class'], + }, +); + sub init_meta { - shift; - my %options = @_; + my ($class, %options) = @_; my $for_class = $options{for_class}; MooseX::ClassAttribute->import({ into => $for_class }); - Moose::Util::MetaRole::apply_metaclass_roles( - for_class => $for_class, - attribute_metaclass_roles => - ['MooseX::AlwaysCoerce::Role::Meta::Attribute'], - metaclass_roles => - ['MooseX::AlwaysCoerce::Role::Meta::Class'], - ); - - return $for_class->meta; + # call generated method to do the rest of the work. + goto $init_meta; } =head1 AUTHOR @@ -106,6 +106,7 @@ Rafael Kitover, C<< <rkitover at cpan.org> >> =head1 CONTRIBUTORS Schwern: Michael G. Schwern <mschwern@cpan.org> +Ether: Karen Etheridge <ether@cpan.org> =head1 BUGS |