diff options
author | doy <doy@tozt.net> | 2009-04-20 22:39:11 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2009-04-20 22:39:11 -0500 |
commit | 067816423e1d927bf885b8fbe3ee343d56bf951c (patch) | |
tree | 54ec0b030b3ec18374535cfee088a1fc29f1141e /lib/MooseX/NonMoose | |
parent | ef80a79adc2f43a8b2bbffa60dcde35d4510ad1b (diff) | |
download | moosex-nonmoose-067816423e1d927bf885b8fbe3ee343d56bf951c.tar.gz moosex-nonmoose-067816423e1d927bf885b8fbe3ee343d56bf951c.zip |
docs for MooseX::NonMoose::Meta::Role::Constructor
Diffstat (limited to 'lib/MooseX/NonMoose')
-rw-r--r-- | lib/MooseX/NonMoose/Meta/Role/Constructor.pm | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/MooseX/NonMoose/Meta/Role/Constructor.pm b/lib/MooseX/NonMoose/Meta/Role/Constructor.pm index cf7083c..24b6966 100644 --- a/lib/MooseX/NonMoose/Meta/Role/Constructor.pm +++ b/lib/MooseX/NonMoose/Meta/Role/Constructor.pm @@ -1,6 +1,39 @@ package MooseX::NonMoose::Meta::Role::Constructor; use Moose::Role; +=head1 NAME + +MooseX::NonMoose::Meta::Role::Constructor - constructor method trait for L<MooseX::NonMoose> + +=head1 SYNOPSIS + + package My::Moose; + use Moose (); + use Moose::Exporter; + + Moose::Exporter->setup_import_methods; + sub init_meta { + shift; + my %options = @_; + Moose->init_meta(%options); + Moose::Util::MetaRole::apply_metaclass_roles( + for_class => $options{for_class}, + metaclass_roles => ['MooseX::NonMoose::Meta::Role::Class'], + constructor_class_roles => + ['MooseX::NonMoose::Meta::Role::Constructor'], + ); + return Class::MOP::class_of($options{for_class}); + } + +=head1 DESCRIPTION + +This trait implements inlining of the constructor for classes using the +L<MooseX::NonMoose::Meta::Role::Class> metaclass trait; it has no effect unless +that trait is also used. See those docs and the docs for L<MooseX::NonMoose> +for more information. + +=cut + around can_be_inlined => sub { my $orig = shift; my $self = shift; @@ -30,4 +63,17 @@ sub _generate_instance { no Moose::Role; +=head1 AUTHOR + + Jesse Luehrs <doy at tozt dot net> + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2009 by Jesse Luehrs. + +This is free software; you can redistribute it and/or modify it under +the same terms as perl itself. + +=cut + 1; |