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