Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

object::authority(3pm) [debian man page]

Object::AUTHORITY(3pm)					User Contributed Perl Documentation				    Object::AUTHORITY(3pm)

NAME
Object::AUTHORITY - adds an AUTHORITY method to your class SYNOPSIS
{ package MyClass; use Object::AUTHORITY; BEGIN { $MyClass::AUTHORITY = 'cpan:TOBYINK'; $MyClass::VERSION = '0.001'; } } print MyClass->AUTHORITY . " "; # prints "cpan:TOBYINK "; MyClass->AUTHORITY('cpan:FOO'); # assertion fails, croaks. DESCRIPTION
This module adds an "AUTHORITY" function to your package, which works along the same lines as the "VERSION" function. The authority of a package can be defined like this: package MyApp; BEGIN { $MyApp::AUTHORITY = 'cpan:JOEBLOGGS'; } The authority should be a URI identifying the person, team, organisation or trained chimp responsible for the release of the package. The pseudo-URI scheme "cpan:" is the most commonly used identifier. "AUTHORITY" Called with no parameters returns the authority of the module. "AUTHORITY($test)" If passed a test, will croak if the test fails. The authority is tested against the test using something approximating Perl 5.10's smart match operator. (Briefly, you can pass a string for "eq" comparison, a regular expression, a code reference to use as a callback, or an array reference that will be grepped.) Utility Function "Object::AUTHORITY::reasonably_smart_match($a, $b)" Object::AUTHORITY exposes its smart match implementation in case classes wish to reuse it for their own custom "AUTHORITY" methods. (There are various interesting use cases for custom "AUTHORITY" methods, just as there are for custom "can" and "isa" methods.) The $a parameter is always assumed to be a simple scalar. BUGS
Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=Object-AUTHORITY <http://rt.cpan.org/Dist/Display.html?Queue=Object- AUTHORITY>. SEE ALSO
o Object::AUTHORITY (this module) - an AUTHORITY method for your class o authority::shared - a more sophisticated AUTHORITY method for your class o UNIVERSAL::AUTHORITY - an AUTHORITY method for every class (deprecated) o UNIVERSAL::AUTHORITY::Lexical - an AUTHORITY method for every class, within a lexical scope o authority - load modules only if they have a particular authority Background reading: <http://feather.perl6.nl/syn/S11.html>, <http://www.perlmonks.org/?node_id=694377>. AUTHOR
Toby Inkster <tobyink@cpan.org>. COPYRIGHT AND LICENCE
This software is copyright (c) 2011 by Toby Inkster. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. perl v5.14.2 2011-12-15 Object::AUTHORITY(3pm)

Check Out this Related Man Page

Class::MOP::Module(3)					User Contributed Perl Documentation				     Class::MOP::Module(3)

NAME
Class::MOP::Module - Module Meta Object VERSION
version 2.1202 DESCRIPTION
A module is essentially a Class::MOP::Package with metadata, in our case the version and authority. INHERITANCE
Class::MOP::Module is a subclass of Class::MOP::Package. METHODS
Class::MOP::Module->create($package, %options) Overrides "create" from Class::MOP::Package to provide these additional options: "version" A version number, to be installed in the $VERSION package global variable. "authority" An authority, to be installed in the $AUTHORITY package global variable. $metamodule->version This is a read-only attribute which returns the $VERSION of the package, if one exists. $metamodule->authority This is a read-only attribute which returns the $AUTHORITY of the package, if one exists. $metamodule->identifier This constructs a string which combines the name, version and authority. Class::MOP::Module->meta This will return a Class::MOP::Class instance for this class. AUTHORS
o Stevan Little <stevan.little@iinteractive.com> o Dave Rolsky <autarch@urth.org> o Jesse Luehrs <doy@tozt.net> o Shawn M Moore <code@sartak.org> o XXXX XXX'XX (Yuval Kogman) <nothingmuch@woobling.org> o Karen Etheridge <ether@cpan.org> o Florian Ragwitz <rafl@debian.org> o Hans Dieter Pearcey <hdp@weftsoar.net> o Chris Prather <chris@prather.org> o Matt S Trout <mst@shadowcat.co.uk> COPYRIGHT AND LICENSE
This software is copyright (c) 2006 by Infinity Interactive, Inc.. 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.18.2 2014-01-19 Class::MOP::Module(3)
Man Page