add clone method
Matt S Trout [Tue, 29 Nov 2011 21:34:57 +0000 (21:34 +0000)]
lib/Tak/Router.pm

index 5c2502b..a8b071c 100644 (file)
@@ -42,4 +42,11 @@ sub deregister {
   delete $self->services->{$name}
 }
 
+sub clone {
+  my ($self) = @_;
+  my $new = (ref $self)->new(services => $self->services);
+  $new->register(meta => Tak::MetaService->new(router => $new));
+  $new;
+}
+
 1;