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

sartak at bestpractical.com sartak at bestpractical.com
Sat Aug 9 12:58:03 EDT 2008


Author: sartak
Date: Sat Aug  9 12:58:03 2008
New Revision: 14947

Modified:
   Prophet/trunk/   (props changed)
   Prophet/trunk/lib/Prophet/CLI/Command.pm
   Prophet/trunk/lib/Prophet/CLI/RecordCommand.pm

Log:
 r69010 at onn:  sartak | 2008-08-09 12:57:57 -0400
 Use predicate has_uuid instead of checking the truthiness of uuid directly


Modified: Prophet/trunk/lib/Prophet/CLI/Command.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI/Command.pm	(original)
+++ Prophet/trunk/lib/Prophet/CLI/Command.pm	Sat Aug  9 12:58:03 2008
@@ -33,7 +33,7 @@
 sub require_uuid {
     my $self    = shift;
 
-    if (!$self->uuid) {
+    if (!$self->has_uuid) {
         my $type = $self->type;
         my $name = (split /::/, $self->meta->name)[-1];
         die "\u$type \l$name requires a luid or uuid (use --id to specify).\n";

Modified: Prophet/trunk/lib/Prophet/CLI/RecordCommand.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI/RecordCommand.pm	(original)
+++ Prophet/trunk/lib/Prophet/CLI/RecordCommand.pm	Sat Aug  9 12:58:03 2008
@@ -3,15 +3,17 @@
 use Params::Validate;
 
 has type => (
-    is       => 'rw',
-    isa      => 'Str',
-    required => 0,
+    is        => 'rw',
+    isa       => 'Str',
+    required  => 0,
+    predicate => 'has_type',
 );
 
 has uuid => (
-    is       => 'rw',
-    isa      => 'Str',
-    required => 0,
+    is        => 'rw',
+    isa       => 'Str',
+    required  => 0,
+    predicate => 'has_uuid',
 );
 
 has record_class => (



More information about the Bps-public-commit mailing list