[Bps-public-commit] r16283 - Prophet/trunk/lib/Prophet

jesse at bestpractical.com jesse at bestpractical.com
Sun Oct 12 17:54:36 EDT 2008


Author: jesse
Date: Sun Oct 12 17:54:35 2008
New Revision: 16283

Modified:
   Prophet/trunk/lib/Prophet/Record.pm

Log:
* EXtract out a create_record method that lets me set a uuid

Modified: Prophet/trunk/lib/Prophet/Record.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Record.pm	(original)
+++ Prophet/trunk/lib/Prophet/Record.pm	Sun Oct 12 17:54:35 2008
@@ -218,8 +218,14 @@
     $self->default_props($args{'props'});
     $self->canonicalize_props( $args{'props'} );
     $self->validate_props( $args{'props'} ) or return undef;
+    $self->_create_record( props => $args{props}, uuid => $uuid);
+}
+
+sub _create_record {
+    my $self = shift;
+    my %args = validate( @_, { props => 1, uuid => 1 } );
 
-    $self->uuid($uuid);
+    $self->uuid($args{uuid});
 
     $self->handle->create_record(
         props => $args{'props'},
@@ -228,8 +234,10 @@
     );
 
     return $self->uuid;
+
 }
 
+
 =head2 load { uuid => $UUID } or { luid => $UUID }
 
 Loads a Prophet record off disk by its uuid or luid.



More information about the Bps-public-commit mailing list