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

sartak at bestpractical.com sartak at bestpractical.com
Tue Jul 22 23:59:56 EDT 2008


Author: sartak
Date: Tue Jul 22 23:59:55 2008
New Revision: 14416

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

Log:
 r64782 at onn:  sartak | 2008-07-22 23:54:42 -0400
 Have CollectionCommand compose the RecordCommand and pass whatever type the user wants to it


Modified: Prophet/trunk/lib/Prophet/CLI/CollectionCommand.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI/CollectionCommand.pm	(original)
+++ Prophet/trunk/lib/Prophet/CLI/CollectionCommand.pm	Tue Jul 22 23:59:55 2008
@@ -1,12 +1,17 @@
-#!/usr/bin/env perl
 package Prophet::CLI::CollectionCommand;
 use Moose::Role;
+with 'Prophet::CLI::RecordCommand';
+
+use Params::Validate;
 
 sub get_collection_object {
     my $self = shift;
-    my %args = @_;
+    my %args = validate(@_, {
+        type => { default => $self->type },
+    });
 
-    my $class = $self->_get_record_class->collection_class;
+    my $record_class = $self->_get_record_class(type => $args{type});
+    my $class = $record_class->collection_class;
     Prophet::App->require_module($class);
 
     my $records = $class->new(



More information about the Bps-public-commit mailing list