fixed the remaining spelling errors + improved some wording in the process
[catagits/Catalyst-Runtime.git] / lib / Catalyst / ClassData.pm
index fd6cd82..f79149b 100644 (file)
@@ -6,14 +6,14 @@ use Class::MOP;
 use Moose::Util ();
 
 sub mk_classdata {
-  my ($class, $attribute) = @_;
+  my ($class, $attribute, $warn_on_instance) = @_;
   confess("mk_classdata() is a class method, not an object method")
     if blessed $class;
 
   my $slot = '$'.$attribute;
   my $accessor =  sub {
     my $pkg = ref $_[0] || $_[0];
-    my $meta = Moose::Util::find_meta($pkg) 
+    my $meta = Moose::Util::find_meta($pkg)
         || Moose::Meta::Class->initialize( $pkg );
     if (@_ > 1) {
       $meta->namespace->{$attribute} = \$_[1];
@@ -49,13 +49,15 @@ sub mk_classdata {
     unless $meta->isa('Class::MOP::Class');
 
   my $was_immutable = $meta->is_immutable;
+  my %immutable_options = $meta->immutable_options;
+
   $meta->make_mutable if $was_immutable;
 
   my $alias = "_${attribute}_accessor";
   $meta->add_method($alias, $accessor);
   $meta->add_method($attribute, $accessor);
 
-  $meta->make_immutable if $was_immutable;
+  $meta->make_immutable(%immutable_options) if $was_immutable;
 
   $class->$attribute($_[2]) if(@_ > 2);
   return $accessor;
@@ -79,8 +81,12 @@ L<Class::Accessor::Grouped>;
 
 =head1 AUTHOR
 
+=begin stopwords
+
 Guillermo Roditi
 
+=end stopwords
+
 =head1 COPYRIGHT
 
 This library is free software. You can redistribute it and/or modify it under