Created
October 14, 2010 22:41
-
-
Save theory/627229 to your computer and use it in GitHub Desktop.
Router::Resource::Match
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Router::Resource::Match; | |
my $def = __PACKAGE__->new(sub { [405], [], ['Method not allowed' ] }); | |
sub not_allowed { $def } | |
sub new { | |
my ($class, $code) = @_; | |
bless $code => $class; | |
} | |
sub execute { shift->(); } | |
sub code { shift eq $def ? 405 : 200 }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment