X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FStorage%2FMeta%2FAttribute%2FDoNotSerialize.pm;h=af4f149cb87d74521c8be10e2a1dda95357afa19;hb=8af2c2b01fe7c63f2748d1b1deca3198c8974b7f;hp=7856ad5bf268cf362a9a534545d95a6fd771216b;hpb=eebcb6dc421f51c455af1dc6b8aa3bb0ffc6f148;p=gitmo%2FMooseX-Storage.git diff --git a/lib/MooseX/Storage/Meta/Attribute/DoNotSerialize.pm b/lib/MooseX/Storage/Meta/Attribute/DoNotSerialize.pm index 7856ad5..af4f149 100644 --- a/lib/MooseX/Storage/Meta/Attribute/DoNotSerialize.pm +++ b/lib/MooseX/Storage/Meta/Attribute/DoNotSerialize.pm @@ -1,11 +1,12 @@ - package MooseX::Storage::Meta::Attribute::DoNotSerialize; use Moose; extends 'Moose::Meta::Attribute'; + with 'MooseX::Storage::Meta::Attribute::Trait::DoNotSerialize'; # register this alias ... package Moose::Meta::Attribute::Custom::DoNotSerialize; + sub register_implementation { 'MooseX::Storage::Meta::Attribute::DoNotSerialize' } 1; @@ -16,12 +17,36 @@ __END__ =head1 NAME -MooseX::Storage::Meta::Attribute::DoNotSerialize +MooseX::Storage::Meta::Attribute::DoNotSerialize - A custom meta-attribute to bypass serialization =head1 SYNOPSIS + package Point; + use Moose; + use MooseX::Storage; + + with Storage('format' => 'JSON', 'io' => 'File'); + + has 'x' => (is => 'rw', isa => 'Int'); + has 'y' => (is => 'rw', isa => 'Int'); + + has 'foo' => ( + metaclass => 'DoNotSerialize', + is => 'rw', + isa => 'CodeRef', + ); + + 1; + =head1 DESCRIPTION +=for stopwords culted + +Sometimes you don't want a particular attribute to be part of the +serialization, in this case, you want to make sure that attribute +uses this custom meta-attribute. See the SYNOPSIS for a nice example +that can be easily cargo-culted. + =head1 METHODS =head2 Introspection @@ -34,7 +59,7 @@ MooseX::Storage::Meta::Attribute::DoNotSerialize =head1 BUGS -All complex software has bugs lurking in it, and this module is no +All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT. @@ -46,7 +71,7 @@ Stevan Little Estevan.little@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2007 by Infinity Interactive, Inc. +Copyright 2007-2008 by Infinity Interactive, Inc. L