X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Singleton.git;a=blobdiff_plain;f=lib%2FMooseX%2FSingleton.pm;h=b73707eeef42b51c8f4d0dbb24f5dcdada335b98;hp=7d00542886f64a4b6e2337cc45013be113f27f55;hb=51e6046bc95a815f79db1c079b4c0ee43243ad2a;hpb=0b3df90672d2c2eb62f71873c44219dea02816fa diff --git a/lib/MooseX/Singleton.pm b/lib/MooseX/Singleton.pm index 7d00542..b73707e 100644 --- a/lib/MooseX/Singleton.pm +++ b/lib/MooseX/Singleton.pm @@ -1,12 +1,12 @@ package MooseX::Singleton; -use Moose 0.82 (); +use Moose 0.94 (); use Moose::Exporter; use MooseX::Singleton::Role::Object; use MooseX::Singleton::Role::Meta::Class; use MooseX::Singleton::Role::Meta::Instance; -our $VERSION = '0.21'; +our $VERSION = '0.23'; $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