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