File Coverage

blib/lib/MooseX/Storage/Engine/Trait/DisableCycleDetection.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package MooseX::Storage::Engine::Trait::DisableCycleDetection;
2             # ABSTRACT: A custom trait to bypass cycle detection
3              
4             our $VERSION = '0.50';
5              
6 1     1   3480 use Moose::Role;
  1         2  
  1         10  
7 1     1   4860 use namespace::autoclean;
  1         2  
  1         10  
8              
9             around 'check_for_cycle_in_collapse' => sub {
10             my ($orig, $self, $attr, $value) = @_;
11             # See NOTE in MX::Storage::Engine
12             return $value;
13             };
14              
15             1;
16              
17             __END__
18              
19             =pod
20              
21             =encoding UTF-8
22              
23             =head1 NAME
24              
25             MooseX::Storage::Engine::Trait::DisableCycleDetection - A custom trait to bypass cycle detection
26              
27             =head1 VERSION
28              
29             version 0.50
30              
31             =head1 SYNOPSIS
32              
33             package Double;
34             use Moose;
35             use MooseX::Storage;
36             with Storage( traits => ['DisableCycleDetection'] );
37              
38             has 'x' => ( is => 'rw', isa => 'HashRef' );
39             has 'y' => ( is => 'rw', isa => 'HashRef' );
40              
41             my $ref = {};
42              
43             my $double = Double->new( 'x' => $ref, 'y' => $ref );
44              
45             $double->pack;
46              
47             =head1 DESCRIPTION
48              
49             C<MooseX::Storage> implements a primitive check for circular references.
50             This check also triggers on simple cases as shown in the Synopsis.
51             Providing the C<DisableCycleDetection> traits disables checks for any cyclical
52             references, so if you know what you are doing, you can bypass this check.
53              
54             This trait is applied to an instance of L<MooseX::Storage::Engine>, for the
55             user-visible version shown in the SYNOPSIS, see L<MooseX::Storage::Traits::DisableCycleDetection>
56              
57             =head1 METHODS
58              
59             =head2 Introspection
60              
61             =over 4
62              
63             =item B<meta>
64              
65             =back
66              
67             =head1 BUGS
68              
69             All complex software has bugs lurking in it, and this module is no
70             exception. If you find a bug please either email me, or add the bug
71             to cpan-RT.
72              
73             =head1 AUTHORS
74              
75             =over 4
76              
77             =item *
78              
79             Chris Prather <chris.prather@iinteractive.com>
80              
81             =item *
82              
83             Stevan Little <stevan.little@iinteractive.com>
84              
85             =item *
86              
87             יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org>
88              
89             =back
90              
91             =head1 COPYRIGHT AND LICENSE
92              
93             This software is copyright (c) 2007 by Infinity Interactive, Inc..
94              
95             This is free software; you can redistribute it and/or modify it under
96             the same terms as the Perl 5 programming language system itself.
97              
98             =cut