X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FSingleton.pm;h=05e6a2ec0fa2e1753d0bc5e6e3b5fe4488faa353;hb=dc7da0cbd6a26ef5c751e2537cc8c4660aab9a50;hp=7d00542886f64a4b6e2337cc45013be113f27f55;hpb=0b3df90672d2c2eb62f71873c44219dea02816fa;p=gitmo%2FMooseX-Singleton.git diff --git a/lib/MooseX/Singleton.pm b/lib/MooseX/Singleton.pm index 7d00542..05e6a2e 100644 --- a/lib/MooseX/Singleton.pm +++ b/lib/MooseX/Singleton.pm @@ -6,7 +6,7 @@ use MooseX::Singleton::Role::Object; use MooseX::Singleton::Role::Meta::Class; use MooseX::Singleton::Role::Meta::Instance; -our $VERSION = '0.21'; +our $VERSION = '0.22'; $VERSION = eval $VERSION; Moose::Exporter->setup_import_methods( also => 'Moose' ); @@ -19,13 +19,15 @@ sub init_meta { my $caller = $p{for_class}; - Moose::Util::MetaRole::apply_metaclass_roles( - for_class => $caller, - metaclass_roles => ['MooseX::Singleton::Role::Meta::Class'], - instance_metaclass_roles => - ['MooseX::Singleton::Role::Meta::Instance'], - constructor_class_roles => - ['MooseX::Singleton::Role::Meta::Method::Constructor'], + Moose::Util::MetaRole::apply_metaroles( + for => $caller, + class_metaroles => { + class => ['MooseX::Singleton::Role::Meta::Class'], + instance => + ['MooseX::Singleton::Role::Meta::Instance'], + constructor => + ['MooseX::Singleton::Role::Meta::Method::Constructor'], + }, ); Moose::Util::MetaRole::apply_base_class_roles( @@ -97,6 +99,12 @@ the singleton object with the given arguments. This clears the existing singleton instance for the class. Obviously, this is meant for use only inside the class itself. +=head2 Singleton->new + +This method currently works like a hybrid of C and +C. However, calling C directly will probably be deprecated in a +future release. Instead, call C or C as appropriate. + =head1 BUGS Please report any bugs or feature requests to