switch Request to invocant + method, clean up Remote using a coderef method
[scpubgit/Tak.git] / lib / Tak / Request.pm
CommitLineData
36cf3bcb 1package Tak::Request;
2
3use Moo;
4
5has tag => (is => 'ro', required => 1);
6
7has respond_to => (is => 'ro', required => 1, weak_ref => 1);
8
ca30c15e 9has respond_with => (is => 'ro', required => 1);
10
36cf3bcb 11sub respond {
12 my $self = shift;
ca30c15e 13 $self->respond_to->${\$self->respond_with}($self->tag => @_);
36cf3bcb 14}
15
161;