fe28dcc3ca2b04dea8f8cb8cdb8f197eb5025d53
[gitmo/MooseX-Storage.git] / lib / MooseX / Storage / Meta / Attribute / DoNotSerialize.pm
1 package MooseX::Storage::Meta::Attribute::DoNotSerialize;
2 use Moose;
3
4 our $VERSION   = '0.35';
5 our $AUTHORITY = 'cpan:STEVAN';
6
7 extends 'Moose::Meta::Attribute';
8    with 'MooseX::Storage::Meta::Attribute::Trait::DoNotSerialize';
9
10 # register this alias ...
11 package Moose::Meta::Attribute::Custom::DoNotSerialize;
12
13 our $VERSION   = '0.35';
14 our $AUTHORITY = 'cpan:STEVAN';
15
16 sub register_implementation { 'MooseX::Storage::Meta::Attribute::DoNotSerialize' }
17
18 1;
19
20 __END__
21
22 =pod
23
24 =head1 NAME
25
26 MooseX::Storage::Meta::Attribute::DoNotSerialize - A custom meta-attribute to bypass serialization
27
28 =head1 SYNOPSIS
29
30   package Point;
31   use Moose;
32   use MooseX::Storage;
33   
34   with Storage('format' => 'JSON', 'io' => 'File');
35   
36   has 'x' => (is => 'rw', isa => 'Int');
37   has 'y' => (is => 'rw', isa => 'Int');
38   
39   has 'foo' => (
40       metaclass => 'DoNotSerialize',
41       is        => 'rw',
42       isa       => 'CodeRef',
43   );
44   
45   1;
46
47 =head1 DESCRIPTION
48
49 Sometimes you don't want a particular attribute to be part of the 
50 serialization, in this case, you want to make sure that attribute 
51 uses this custom meta-attribute. See the SYNOPSIS for a nice example
52 that can be easily cargo-culted.
53
54 =head1 METHODS
55
56 =head2 Introspection
57
58 =over 4
59
60 =item B<meta>
61
62 =back
63
64 =head1 BUGS
65
66 All complex software has bugs lurking in it, and this module is no 
67 exception. If you find a bug please either email me, or add the bug
68 to cpan-RT.
69
70 =head1 AUTHOR
71
72 Chris Prather E<lt>chris.prather@iinteractive.comE<gt>
73
74 Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
75
76 =head1 COPYRIGHT AND LICENSE
77
78 Copyright 2007-2008 by Infinity Interactive, Inc.
79
80 L<http://www.iinteractive.com>
81
82 This library is free software; you can redistribute it and/or modify
83 it under the same terms as Perl itself.
84
85 =cut