Make all classes immutable
Dave Rolsky [Fri, 21 Jan 2011 20:07:27 +0000 (14:07 -0600)]
15 files changed:
lib/Catalyst/Action/Deserialize/Data/Serializer.pm
lib/Catalyst/Action/Deserialize/JSON.pm
lib/Catalyst/Action/Deserialize/View.pm
lib/Catalyst/Action/Deserialize/XML/Simple.pm
lib/Catalyst/Action/Deserialize/YAML.pm
lib/Catalyst/Action/REST.pm
lib/Catalyst/Action/Serialize/Data/Serializer.pm
lib/Catalyst/Action/Serialize/JSON.pm
lib/Catalyst/Action/Serialize/JSON/XS.pm
lib/Catalyst/Action/Serialize/JSONP.pm
lib/Catalyst/Action/Serialize/View.pm
lib/Catalyst/Action/Serialize/XML/Simple.pm
lib/Catalyst/Action/Serialize/YAML.pm
lib/Catalyst/Action/Serialize/YAML/HTML.pm
lib/Catalyst/Controller/REST.pm

index 252b785..d792daa 100644 (file)
@@ -42,4 +42,6 @@ sub execute {
     return 1;
 }
 
+__PACKAGE__->meta->make_immutable;
+
 1;
index 880e02d..10a7657 100644 (file)
@@ -12,4 +12,6 @@ sub execute {
     return 1;
 }
 
+__PACKAGE__->meta->make_immutable;
+
 1;
index e9f28c9..03057e5 100644 (file)
@@ -44,4 +44,6 @@ sub execute {
     return 1;
 }
 
+__PACKAGE__->meta->make_immutable;
+
 1;
index ef8e07a..ef00997 100644 (file)
@@ -32,4 +32,6 @@ sub execute {
     return 1;
 }
 
+__PACKAGE__->meta->make_immutable;
+
 1;
index 14362bf..8228380 100644 (file)
@@ -13,11 +13,11 @@ BEGIN { require 5.008001; }
 our $VERSION = '0.88';
 $VERSION = eval $VERSION;
 
-sub new {
-  my $class  = shift;
-  my $config = shift;
-  Catalyst::Request::REST->_insert_self_into( $config->{class} );
-  return $class->next::method($config, @_);
+sub BUILDARGS {
+    my $class  = shift;
+    my $config = shift;
+    Catalyst::Request::REST->_insert_self_into( $config->{class} );
+    return $class->SUPER::BUILDARGS($config, @_);
 }
 
 =head1 NAME
@@ -151,6 +151,8 @@ sub _return_not_implemented {
           . $c->uri_for( $method_name ) );
 }
 
+__PACKAGE__->meta->make_immutable;
+
 1;
 
 =back
index 7f7f551..dfef62e 100644 (file)
@@ -34,4 +34,6 @@ sub execute {
     return 1;
 }
 
+__PACKAGE__->meta->make_immutable;
+
 1;
index 9e1521e..30cf2d2 100644 (file)
@@ -39,4 +39,6 @@ sub serialize {
     $self->encoder->encode( $data );
 }
 
+__PACKAGE__->meta->make_immutable;
+
 1;
index ed8f858..3db7505 100644 (file)
@@ -14,4 +14,6 @@ sub _build_encoder {
    return JSON::XS->new->convert_blessed;
 }
 
+__PACKAGE__->meta->make_immutable;
+
 1;
index 38b15aa..eb67cc3 100644 (file)
@@ -28,4 +28,6 @@ after 'execute' => sub {
   }
 };
 
+__PACKAGE__->meta->make_immutable;
+
 1;
index 653adf0..2b43e74 100644 (file)
@@ -37,4 +37,6 @@ sub execute {
     }
 }
 
+__PACKAGE__->meta->make_immutable;
+
 1;
index 7d636c2..680cb3a 100644 (file)
@@ -32,4 +32,6 @@ sub execute {
     return 1;
 }
 
+__PACKAGE__->meta->make_immutable;
+
 1;
index 316ddfa..e51162d 100644 (file)
@@ -29,4 +29,6 @@ sub serialize {
     Dump($data);
 }
 
+__PACKAGE__->meta->make_immutable;
+
 1;
index 4cd14d5..fb3653f 100644 (file)
@@ -45,4 +45,6 @@ sub execute {
     return 1;
 }
 
+__PACKAGE__->meta->make_immutable;
+
 1;
index 3ff4b3f..b6b4378 100644 (file)
@@ -623,4 +623,6 @@ You may distribute this code under the same terms as Perl itself.
 
 =cut
 
+__PACKAGE__->meta->make_immutable;
+
 1;