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

sartak at bestpractical.com sartak at bestpractical.com
Tue Jul 22 02:25:44 EDT 2008


Author: sartak
Date: Tue Jul 22 02:25:44 2008
New Revision: 14355

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

Log:
 r64705 at onn:  sartak | 2008-07-22 02:02:19 -0400
 Factor out getting the value out of an atom so we can use it elsewhere


Modified: Prophet/trunk/lib/Prophet/Record.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Record.pm	(original)
+++ Prophet/trunk/lib/Prophet/Record.pm	Tue Jul 22 02:25:44 2008
@@ -413,21 +413,23 @@
     return join ' ', map { $_->{formatted} } @out;
 }
 
-sub format_atom {
-    my $self = shift;
-    my $string = shift;
+sub atom_value {
+    my $self     = shift;
     my $value_in = shift;
-    my $value;
+
     if ($value_in =~ /^\$[gu]uid/) {
-            $value = $self->uuid;
+        return $self->uuid;
     } elsif ($value_in eq '$luid') {
-            $value = $self->luid;
-    } else {
-            $value = $value_in;
-    }
-    return sprintf($string, $value);
+        return $self->luid;
+    return $value_in;
 }
 
+sub format_atom {
+    my $self = shift;
+    my $string = shift;
+    my $value_in = shift;
+    return sprintf($string, $self->atom_value($value_in));
+}
 
 =head2 find_or_create_luid
 



More information about the Bps-public-commit mailing list