bump version and update changes for 0.65_05
[gitmo/Class-MOP.git] / lib / Class / MOP / Immutable.pm
index 2318346..9575c39 100644 (file)
@@ -9,7 +9,8 @@ use Class::MOP::Method::Constructor;
 use Carp         'confess';
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.65';
+our $VERSION   = '0.64_05';
+$VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
 use base 'Class::MOP::Object';
@@ -31,12 +32,11 @@ sub new {
         $metaclass = $options{metaclass};
     }
 
-    # FIXME make a proper constructor using ->meta->new_object
-    my $self = bless {
+    my $self = $class->_new(
         'metaclass'           => $metaclass,
         'options'             => $options,
         'immutable_metaclass' => undef,
-    } => $class;
+    );
 
     # NOTE:
     # we initialize the immutable
@@ -47,6 +47,13 @@ sub new {
     return $self;
 }
 
+sub _new {
+    my $class = shift;
+    my $options = @_ == 1 ? $_[0] : {@_};
+
+    bless $options, $class;
+}
+
 sub immutable_metaclass { (shift)->{'immutable_metaclass'} }
 sub metaclass           { (shift)->{'metaclass'}           }
 sub options             { (shift)->{'options'}             }