From: Stevan Little Date: Wed, 6 Feb 2008 20:23:51 +0000 (+0000) Subject: adding make_immutable sugar X-Git-Tag: 0_37~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2a5e59d0b0d49d5f97815f70443783d288cee8c7;p=gitmo%2FMoose.git adding make_immutable sugar --- diff --git a/Changes b/Changes index 9570b53..77abe95 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,8 @@ Revision history for Perl extension Moose - added tests for this (thanks thepler) - 'has' now dies if you don't pass in name value pairs + - added the 'make_immutable' keyword as a shortcut + to __PACKAGE__->meta->make_immutable * Moose::Meta::Class Moose::Meta::Method::Constructor diff --git a/lib/Moose.pm b/lib/Moose.pm index e5c8a28..ca5ac15 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -161,6 +161,12 @@ use Moose::Util (); $class->meta->add_augment_method_modifier( $name => $method ); }; }, + make_immutable => sub { + my $class = $CALLER; + return subname 'Moose::make_immutable' => sub { + $class->meta->make_immutable(@_) + }; + }, confess => sub { return \&Carp::confess; },