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