[Bps-public-commit] r14449 - sd/trunk/lib/App/SD

cwest at bestpractical.com cwest at bestpractical.com
Wed Jul 23 20:27:19 EDT 2008


Author: cwest
Date: Wed Jul 23 20:27:18 2008
New Revision: 14449

Modified:
   sd/trunk/lib/App/SD/Record.pm

Log:
Use around from Moose

Modified: sd/trunk/lib/App/SD/Record.pm
==============================================================================
--- sd/trunk/lib/App/SD/Record.pm	(original)
+++ sd/trunk/lib/App/SD/Record.pm	Wed Jul 23 20:27:18 2008
@@ -11,9 +11,9 @@
 
 extends 'Prophet::Record';
 
-sub get_props {
-    my $self = shift;
-    my $props = $self->SUPER::get_props(@_);
+around get_props => sub {
+    my ($next, $self, @args) = @_;
+    my $props = $self->$next(@args);
 
     $self->set_props(props => { created => $props->{date} })
       if !$props->{created} && $props->{date};
@@ -21,8 +21,8 @@
     $self->set_props(props => {date => undef})
       if $props->{date};
 
-    return $self->SUPER::get_props(@_);
-}
+    return $self->$next(@args);
+};
 
 sub canonicalize_prop_created {
     my $self = shift;



More information about the Bps-public-commit mailing list