[Bps-public-commit] r14458 - in Prophet/trunk: .

sartak at bestpractical.com sartak at bestpractical.com
Thu Jul 24 01:07:58 EDT 2008


Author: sartak
Date: Thu Jul 24 01:07:56 2008
New Revision: 14458

Modified:
   Prophet/trunk/   (props changed)
   Prophet/trunk/lib/Prophet/Replica/Native.pm

Log:
 r64981 at onn:  sartak | 2008-07-24 00:56:39 -0400
 Make db_uuid a lazy attribute instead of having a dedicated method to check it


Modified: Prophet/trunk/lib/Prophet/Replica/Native.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/Native.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica/Native.pm	Thu Jul 24 01:07:56 2008
@@ -11,8 +11,9 @@
 use Prophet::ChangeSet;
 use Prophet::Conflict;
 
-has _db_uuid => (
-    is => 'rw',
+has '+db_uuid' => (
+    lazy    => 1,
+    default => sub { shift->_read_file('database-uuid') },
 );
 
 has _uuid => (
@@ -229,13 +230,6 @@
 
 }
 
-sub db_uuid {
-    my $self = shift;
-    $self->_db_uuid( $self->_read_file('database-uuid') )
-        unless $self->_db_uuid;
-    return $self->_db_uuid;
-}
-
 before set_db_uuid => sub {
     my $self = shift;
     my $uuid = shift;



More information about the Bps-public-commit mailing list