-
-
07 Apr 2013 22:39:57 UTC
- Distribution: MooX-Singleton
- Module version: 1.20
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (0)
- Testers (8736 / 2 / 0)
- Kwalitee
Bus factor: 0- 91.84% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (14.08KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
MooX::Singleton - turn your Moo class into singleton
VERSION
version 1.20
SYNOPSIS
package MyApp; use Moo; with 'MooX::Singleton'; package main; my $instance = MyApp->instance(@optional_init_args); my $same = MyApp->instance;
DESCRIPTION
Role::Tiny role that provides "instance" method turning your object into singleton.
METHODS
instance
my $singleton = MyApp->instance(@args1); my $same = MyApp->instance; # @args2 are ignored my $above = MyApp->instance(@args2);
Creates a new object initialized with arguments provided and then returns it.
NOTE: Subsequent calls to
instance
will return the singleton instance ignoring any arguments. This is different from MooseX::Singleton which does not allow any arguments.AUTHOR
Alex J. G. Burzyński <ajgb@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Alex J. G. Burzyński <ajgb@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install MooX::Singleton, copy and paste the appropriate command in to your terminal.
cpanm MooX::Singleton
perl -MCPAN -e shell install MooX::Singleton
For more information on module installation, please visit the detailed CPAN module installation guide.