add can::on
[scpubgit/Object-Remote.git] / lib / Object / Remote.pm
index fc6e955..485821d 100644 (file)
@@ -10,6 +10,12 @@ sub new::on {
   return $conn->remote_object(class => $class, args => \@args);
 }
 
+sub can::on {
+  my ($class, $on, $name) = @_;
+  my $conn = __PACKAGE__->connect($on);
+  return $conn->remote_sub(join('::', $class, $name));
+}
+
 sub new {
   shift;
   Object::Remote::Handle->new(@_)->proxy;