From: gfx Date: Sat, 28 Nov 2009 07:40:30 +0000 (+0900) Subject: Add immutable_optins X-Git-Tag: 0.40_09~23 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cfef75f0e43d8f855bda286190b7c94c33b0c187;p=gitmo%2FMouse.git Add immutable_optins --- diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index 3138726..5ff6711 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -226,14 +226,22 @@ sub clone_instance { return $class->clone_object($instance, %params); } -sub make_immutable { - my $self = shift; - my %args = ( + +sub immutable_options { + my ( $self, @args ) = @_; + + return ( inline_constructor => 1, inline_destructor => 1, constructor_name => 'new', - @_, + @args, ); +} + + +sub make_immutable { + my $self = shift; + my %args = $self->immutable_options(@_); $self->{is_immutable}++;