Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
MooX::Singleton(3)    User Contributed Perl Documentation   MooX::Singleton(3)

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. BurzyAski <ajgb@cpan.org>

COPYRIGHT AND LICENSE
       This software is	copyright (c) 2012 by Alex J. G. BurzyAski
       <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.

perl v5.32.1			  2013-04-07		    MooX::Singleton(3)

NAME | VERSION | SYNOPSIS | DESCRIPTION | METHODS | AUTHOR | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=MooX::Singleton&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help