X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Action-REST.git;a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FREST.pm;h=cbd2095e2091486cbaf00c81bde68fdd5c8cf741;hp=27705fcaa92d04a67e0ee5297b3dda0741b4df4b;hb=3bb36dcaabf34fef5c15b1bb74c5eb198a7f5168;hpb=930013e6f19b25a090c3f8839495ad8d9b15ff6d diff --git a/lib/Catalyst/Action/REST.pm b/lib/Catalyst/Action/REST.pm index 27705fc..cbd2095 100644 --- a/lib/Catalyst/Action/REST.pm +++ b/lib/Catalyst/Action/REST.pm @@ -10,7 +10,7 @@ use Catalyst::Controller::REST; BEGIN { require 5.008001; } -our $VERSION = '0.79'; +our $VERSION = '0.82'; $VERSION = eval $VERSION; sub new { @@ -67,8 +67,8 @@ It is likely that you really want to look at L, which brings this class together with automatic Serialization of requests and responses. -When you use this module, the request class will be changed to -L. +When you use this module, it adds the L +role to your request class. =head1 METHODS @@ -125,14 +125,8 @@ sub dispatch { sub _get_allowed_methods { my ( $self, $controller, $c, $name ) = @_; my $class = ref($controller) ? ref($controller) : $controller; - my $methods = Class::Inspector->methods($class); - my @allowed; - foreach my $method ( @{$methods} ) { - if ( $method =~ /^$name\_(.+)$/ ) { - push( @allowed, $1 ); - } - } - return @allowed; + my $methods = Class::Inspector->methods($class); + return map { /^$name\_(.+)$/ } @$methods; }; sub _return_options { @@ -162,8 +156,13 @@ sub _return_not_implemented { =head1 SEE ALSO -You likely want to look at L, which implements -a sensible set of defaults for a controller doing REST. +You likely want to look at L, which implements a +sensible set of defaults for a controller doing REST. + +This class automatically adds the L role to +your request class. If you're writing a webapp which provides RESTful +responses and still needs to accommodate web browsers, you may prefer to use +L instead. L, L @@ -186,27 +185,29 @@ for this to run smoothly. =head1 AUTHOR -Adam Jacob , with lots of help from mst and jrockway +Adam Jacob Eadam@stalecoffee.orgE, with lots of help from mst and jrockway Marchex, Inc. paid me while I developed this module. (L) =head1 CONTRIBUTORS -Arthur Axel "fREW" Schmidt +Tomas Doran (t0m) Ebobtfish@bobtfish.netE + +John Goulah Christopher Laco -Luke Saunders +Daisuke Maki Edaisuke@endeworks.jpE -John Goulah +Hans Dieter Pearcey -Daisuke Maki +Dave Rolsky Eautarch@urth.orgE -J. Shirley +Luke Saunders -Hans Dieter Pearcey +Arthur Axel "fREW" Schmidt Efrioux@gmail.comE -Tomas Doran (t0m) +J. Shirley Ejshirley@gmail.comE =head1 COPYRIGHT