[Moose-commits] r7734 - in MooseX-GlobRef/trunk: .
lib/MooseX/GlobRef/Role
dexter at code2.0beta.co.uk
dexter at code2.0beta.co.uk
Thu Feb 19 21:14:43 GMT 2009
Author: dexter
Date: 2009-02-19 13:14:43 -0800 (Thu, 19 Feb 2009)
New Revision: 7734
Modified:
MooseX-GlobRef/trunk/Changes
MooseX-GlobRef/trunk/lib/MooseX/GlobRef/Role/Object.pm
Log:
* MooseX::GlobRef::Role::Object: 'around' modifier for "dump" method.
Modified: MooseX-GlobRef/trunk/Changes
===================================================================
--- MooseX-GlobRef/trunk/Changes 2009-02-19 17:05:45 UTC (rev 7733)
+++ MooseX-GlobRef/trunk/Changes 2009-02-19 21:14:43 UTC (rev 7734)
@@ -1,5 +1,5 @@
------------------------------------------------------------------------
-0.07 | Piotr Roszatycki <dexter at debian.org> | 2009-02-13
+0.07 | Piotr Roszatycki <dexter at debian.org> | 2009-02-19
Changes:
Modified: MooseX-GlobRef/trunk/lib/MooseX/GlobRef/Role/Object.pm
===================================================================
--- MooseX-GlobRef/trunk/lib/MooseX/GlobRef/Role/Object.pm 2009-02-19 17:05:45 UTC (rev 7733)
+++ MooseX-GlobRef/trunk/lib/MooseX/GlobRef/Role/Object.pm 2009-02-19 21:14:43 UTC (rev 7734)
@@ -64,7 +64,7 @@
=over
-=item dump( I<maxdepth> : Int = 1 ) : Array|Str
+=item <<around>> dump( I<maxdepth> : Int = 1 ) : Array|Str
Dumps the object itself and also a hash slot of glob reference of this object.
It returns an array or string depended on context.
@@ -75,11 +75,12 @@
=cut
-override 'dump' => sub {
+around 'dump' => sub {
+ my $super = shift;
my ($self, $maxdepth) = @_;
require Data::Dumper;
local $Data::Dumper::Maxdepth = $maxdepth || 1;
- my @dump = (super, Data::Dumper::Dumper( \%{*$self} ));
+ my @dump = ( $super->(@_), Data::Dumper::Dumper( \%{*$self} ) );
return wantarray ? @dump : join('', @dump);
};
More information about the Moose-commits
mailing list