package MooseX::Storage::Traits::DisableCycleDetection;
use Moose::Role;
-our $VERSION = '0.18';
+our $VERSION = '0.22';
our $AUTHORITY = 'cpan:STEVAN';
+requires 'pack';
+requires 'unpack';
+
+around 'pack' => sub {
+ my ($orig, $self, %args) = @_;
+ $args{engine_traits} ||= [];
+ push(@{$args{engine_traits}}, 'DisableCycleDetection');
+ $self->$orig(%args);
+};
+
+around 'unpack' => sub {
+ my ($orig, $self, $data, %args) = @_;
+ $args{engine_traits} ||= [];
+ push(@{$args{engine_traits}}, 'DisableCycleDetection');
+ $self->$orig($data, %args);
+};
+
+no Moose::Role;
+
1;
__END__
use Moose;
use MooseX::Storage;
with Storage( traits => ['DisableCycleDetection'] );
-
+
has 'x' => ( is => 'rw', isa => 'HashRef' );
has 'y' => ( is => 'rw', isa => 'HashRef' );
my $ref = {};
my $double = Double->new( 'x' => $ref, 'y' => $ref );
-
+
$double->pack;
-
-
+
=head1 DESCRIPTION
C<MooseX::Storage> implements a primitive check for circular references.
=head1 BUGS
-All complex software has bugs lurking in it, and this module is no
+All complex software has bugs lurking in it, and this module is no
exception. If you find a bug please either email me, or add the bug
to cpan-RT.
it under the same terms as Perl itself.
=cut
+