Commit | Line | Data |
---|---|---|
36cf3bcb | 1 | package Tak::Request; |
2 | ||
3 | use Moo; | |
4 | ||
5 | has tag => (is => 'ro', required => 1); | |
6 | ||
7 | has respond_to => (is => 'ro', required => 1, weak_ref => 1); | |
8 | ||
ca30c15e | 9 | has respond_with => (is => 'ro', required => 1); |
10 | ||
36cf3bcb | 11 | sub respond { |
12 | my $self = shift; | |
ca30c15e | 13 | $self->respond_to->${\$self->respond_with}($self->tag => @_); |
36cf3bcb | 14 | } |
15 | ||
16 | 1; |