Add docs for the undocumented classes
[gitmo/MooseX-Storage.git] / lib / MooseX / Storage / Engine / Trait / DisableCycleDetection.pm
CommitLineData
a473d69d 1package MooseX::Storage::Engine::Trait::DisableCycleDetection;
2use Moose::Role;
3
3513de05 4around 'check_for_cycle_in_collapse' => sub {
5 my ($orig, $self, $attr, $value) = @_;
6 # See NOTE in MX::Storage::Engine
7 return $value;
8};
9
a473d69d 101;
11
511f9c4b 12=head1 NAME
13
14MooseX::Storage::Engine::Trait::DisableCycleDetection - A custom trait to bypass cycle detection
15
16=head1 SYNOPSIS
17
18 package Double;
19 use Moose;
20 use MooseX::Storage;
21 with Storage( traits => ['DisableCycleDetection'] );
22
23 has 'x' => ( is => 'rw', isa => 'HashRef' );
24 has 'y' => ( is => 'rw', isa => 'HashRef' );
25
26 my $ref = {};
27
28 my $double = Double->new( 'x' => $ref, 'y' => $ref );
29
30 $double->pack;
31
32=head1 DESCRIPTION
33
34C<MooseX::Storage> implements a primitive check for circular references.
35This check also triggers on simple cases as shown in the Synopsis.
36Providing the C<DisableCycleDetection> traits disables checks for any cyclical
37references, so if you know what you are doing, you can bypass this check.
38
39This trait is applied to an instance of L<MooseX::Storage::Engine>, for the
40user-visible version shown in the SYNOPSIS, see L<MooseX::Storage::Traits::DisableCycleDetection>
41
42=head1 METHODS
43
44=head2 Introspection
45
46=over 4
47
48=item B<meta>
49
50=back
51
52=head1 BUGS
53
54All complex software has bugs lurking in it, and this module is no
55exception. If you find a bug please either email me, or add the bug
56to cpan-RT.
57
58=head1 AUTHOR
59
60Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
61
62=head1 COPYRIGHT AND LICENSE
63
64Copyright 2007-2008 by Infinity Interactive, Inc.
65
66L<http://www.iinteractive.com>
67
68This library is free software; you can redistribute it and/or modify
69it under the same terms as Perl itself.
70
71=cut
72