MooseX::Traits::Attribute::CascadeClearMaster.3pm

Langue: en

Version: 2009-01-17 (fedora - 05/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

MooseX::Traits::Attribute::CascadeClearMaster - Master clearer metatrait

SYNOPSIS

     # our "master" attribute
     has master => (
 
         # overrides our clearer method to check for dependent atts to clear
         traits     => [ 'CascadeClearMaster' ], 
         is         => 'rw',
         isa        => 'Str',
         lazy       => 1,
         default    => 'nuts',
     );
 
     has client1 => (
 
         # mark us for clearing on clear_master()
         traits   => [ 'CascadeClear' ], 
         clear_on => 'master', 
 
         is      => 'ro', 
         isa     => 'Str', 
         lazy    => 1,
         default => sub { shift->master . "1" }
     );
 
 

DESCRIPTION

CascadeClearer is an attribute metaclass trait that allows one to chain attribute clearing actions. For instance, if you have attributes that derive their value from a ``master'' attribute, this would transparently allow you to clear all the children attributes by clearing the master attribute.

USAGE

See MooseX::Traits::Attribute::CascadeClear.

BUGS AND LIMITATIONS

There are no known bugs in this module.

Please report problems or requests to this package's RT tracker at <bug-MooseX-Traits-Attribute-CascadeClear@rt.cpan.org>.

Patches are welcome.

AUTHOR

Chris Weyl <cweyl@alumni.drew.edu> Copyright (c) 2008 Chris Weyl <cweyl@alumni.drew.edu>

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library 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 Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA