|
Class::Accessor::Fast::Contained - Fast accessors with data containment |
Class::Accessor::Fast::Contained - Fast accessors with data containment
This document refers to version 0.05 of Class::Accessor::Fast::Contained, released Tuesday Sep 19, 2006.
package Foo; use base qw(Class::Accessor::Fast::Contained);
# The rest is the same as Class::Accessor::Fast
This module does two things differently to the venerable Class::Accessor::Fast :
new() allows mixin into an existing object, rather than creating and
returning a new blessed hashref. To do this, just call something like:
my $self = Some::Other::Class->new; $self = $self->Class::Accessor::Fast::Contained::new;
Note that the mixin code only supports objects which use a blessed hash reference or a blessed typeglob reference.
An alias setup() is available which does the same as new() but might
make more sense if being used in this way.
Other than the standard Perl distribution, you will need the following:
If you spot a bug or are experiencing difficulties that are not explained within the documentation, please send an email to oliver@cpan.org or submit a bug to the RT system (http://rt.cpan.org/). It would help greatly if you are able to pinpoint problems or even supply a patch.
Oliver Gorwits <oliver.gorwits@oucs.ox.ac.uk>
Thanks to Marty Pauly and Michael G Schwern for the Class::Accessor manpage and its tests, which I've shamelessly borrowed for this distribution.
Copyright (c) The University of Oxford 2006. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Class::Accessor::Fast::Contained - Fast accessors with data containment |