From: Matt S Trout Date: Tue, 29 Nov 2011 21:34:57 +0000 (+0000) Subject: add clone method X-Git-Tag: v0.001002~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fe725d6e99834f26f20ce3f78eda9591c0d4a7d1;p=scpubgit%2FTak.git add clone method --- diff --git a/lib/Tak/Router.pm b/lib/Tak/Router.pm index 5c2502b..a8b071c 100644 --- a/lib/Tak/Router.pm +++ b/lib/Tak/Router.pm @@ -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;