|
NAMEClass::NamedParms - A lightweight base class for checked get/set property accessorsSYNOPSISpackage SomePackage; use Class::NamedParms; use vars qw (@ISA); @ISA=qw(Class::NamedParms); sub new { my $proto = shift; my $class = ref ($proto) || $proto; my $self = Class::NamedParms->new(qw(benefits costs)); $self = bless $self,$class; return $self; } $thingy = SomePackage->new; $thingy->set({ benefits => 1, costs => 0.5 }); my ($costs,$benefits) = $thingy->get('costs', 'benefits'); DESCRIPTIONProvides key name checking for named accessor parameters. This allows the use of a generic 'get/set' type parameterized accessor while automatically catching accidental mis-spellings and usage of uninitialized parameters. This catches a large class of programming errors without requiring a new accessor for every object parameter.It can also be used as a standalone generic 'container' object. Example: my $plant = Class::NamedParms->new(qw(phylum family genera species)); $plant->set({ species => 'Homo Sapiens Sapiens' }); CHANGES1.00 1999.06.16 - Initial release. 1.01 1999.06.17 - Bug fix to 'clear' method. Added 'make test' support. 1.02 1999.06.18 - Performance tweak to 'get' method. 1.03 1999.06.21 - Minor docs tweaks. Removal of 'use attrs' for portability 1.04 1999.10.08 - Bug fix to 'all_parms' method 1.05 2005.09.19 - Added GPL_License.txt, Artistic_License.txt, LICENSE, Changes, Build.PL. Added pod build tests. Split documentation into .pod file. Extended build tests to 100% code coverage. Refactored code to make it more inheritance friendly. Updated documentation. 1.06 2005.09.20 - Fixed bad pod coverage build test. 1.07 2020.10.10 - Relicensed under MIT License. Maintainer info updated. Build tooling updated. Documentation updates 1.08 2020.10.10 - Added LICENSE file that was inadvertently omitted in 1.07 METHODS
AUTHORJerilyn Franz <cpan@jerilyn.info>VERSION1.07 2020.10.10TODONothing.COPYRIGHTCopyright 1999-2020, Jerilyn Franz and FreeRun Technologies, Inc. All Rights Reserved.LICENSEMIT LicenseCopyright (c) 2020 Jerilyn Franz, Freerun Technologies Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Visit the GSP FreeBSD Man Page Interface. |