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