X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=lib%2FObject%2FRemote%2FConnection.pm;h=a5ad3021563fac8e1f74aa09a08c15122cab48df;hp=291b5540820522822e2314c7f770f87f9f153148;hb=e144d525c19bc4488952e4cea0ea0fe47a8db133;hpb=b10f7b24841937ce24963e8185af3b418c1eebfd diff --git a/lib/Object/Remote/Connection.pm b/lib/Object/Remote/Connection.pm index 291b554..a5ad302 100644 --- a/lib/Object/Remote/Connection.pm +++ b/lib/Object/Remote/Connection.pm @@ -92,12 +92,20 @@ BEGIN { sub new_from_spec { my ($class, $spec) = @_; + return $spec if blessed $spec; foreach my $poss (do { our @Guess }) { if (my $obj = $poss->($spec)) { return $obj } } die "Couldn't figure out what to do with ${spec}"; } +sub new_remote { + my ($self, @args) = @_; + Object::Remote::Handle->new( + connection => $self, @args + )->proxy; +} + sub register_remote { my ($self, $remote) = @_; weaken($self->remote_objects_by_id->{$remote->id} = $remote);