summary refs log tree commit diff
path: root/lib/Net/HTTP/Spore/Middleware.pm
blob: 0b8584c39c379f87e1300e2e5536b1070c35a20a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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;