diff options
| author | franck cuny <franck@lumberjaph.net> | 2010-06-06 16:52:32 +0200 |
|---|---|---|
| committer | franck cuny <franck@lumberjaph.net> | 2010-06-06 16:52:32 +0200 |
| commit | 6754c25c01c202ff788ffba6265d98b4b75f4db4 (patch) | |
| tree | 8ec3b04963a14462a51479555381cdec361f5f43 /lib/Net/HTTP/Console/Dispatcher.pm | |
| download | net-http-console-6754c25c01c202ff788ffba6265d98b4b75f4db4.tar.gz | |
initial commit
Diffstat (limited to 'lib/Net/HTTP/Console/Dispatcher.pm')
| -rw-r--r-- | lib/Net/HTTP/Console/Dispatcher.pm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/Net/HTTP/Console/Dispatcher.pm b/lib/Net/HTTP/Console/Dispatcher.pm new file mode 100644 index 0000000..052e493 --- /dev/null +++ b/lib/Net/HTTP/Console/Dispatcher.pm @@ -0,0 +1,21 @@ +package Net::HTTP::Console::Dispatcher; + +use Moose::Role; + +has application => (is => 'rw', isa => 'Net::HTTP::Console'); + +requires qw/dispatch pattern/; + +around dispatch => sub { + my $orig = shift; + my $self = shift; + my $in = shift; + + if (my $r = $self->pattern($in)) { + return $self->$orig($r); + }else{ + return undef; + } +}; + +1; |
