blob: 0b8584c39c379f87e1300e2e5536b1070c35a20a (
plain) (
tree)
|
|
package Net::HTTP::Spore::Middleware;
use strict;
use warnings;
sub new {
my $class = shift;
bless {@_}, $class;
}
sub response_cb {
my ($self, $cb) = @_;
my $body_filter = sub {
my $filter = $cb->(@_);
};
return $body_filter;
}
sub wrap {
my ($self, @args) = @_;
if (!ref $self) {
$self = $self->new(@args);
}
return sub {
$self->call(@_);
};
}
1;
|