Remove p6 style attribute naming
[gitmo/Class-MOP.git] / lib / Class / MOP / Instance.pm
index 90bddbc..50cd23e 100644 (file)
@@ -6,13 +6,10 @@ use warnings;
 
 use Scalar::Util 'weaken', 'blessed';
 
-our $VERSION   = '0.04';
+our $VERSION   = '0.65';
 our $AUTHORITY = 'cpan:STEVAN';
 
-sub meta {
-    require Class::MOP::Class;
-    Class::MOP::Class->initialize(blessed($_[0]) || $_[0]);
-}
+use base 'Class::MOP::Object';
 
 sub new {
     my ($class, $meta, @attrs) = @_;
@@ -28,16 +25,16 @@ sub new {
         # which is *probably* a safe
         # assumption,.. but you can
         # never tell <:)
-        '$!meta'  => $meta,
-        '@!slots' => { map { $_ => undef } @slots },
+        'meta'  => $meta,
+        'slots' => { map { $_ => undef } @slots },
     } => $class;
 
-    weaken($instance->{'$!meta'});
+    weaken($instance->{'meta'});
 
     return $instance;
 }
 
-sub associated_metaclass { (shift)->{'$!meta'} }
+sub associated_metaclass { (shift)->{'meta'} }
 
 sub create_instance {
     my $self = shift;
@@ -58,12 +55,12 @@ sub clone_instance {
 
 sub get_all_slots {
     my $self = shift;
-    return keys %{$self->{'@!slots'}};
+    return keys %{$self->{'slots'}};
 }
 
 sub is_valid_slot {
     my ($self, $slot_name) = @_;
-    exists $self->{'@!slots'}->{$slot_name};
+    exists $self->{'slots'}->{$slot_name};
 }
 
 # operations on created instances
@@ -80,7 +77,7 @@ sub set_slot_value {
 
 sub initialize_slot {
     my ($self, $instance, $slot_name) = @_;
-    #$self->set_slot_value($instance, $slot_name, undef);
+    return;
 }
 
 sub deinitialize_slot {
@@ -148,7 +145,7 @@ sub inline_set_slot_value {
 
 sub inline_initialize_slot {
     my ($self, $instance, $slot_name) = @_;
-    $self->inline_set_slot_value($instance, $slot_name, 'undef'),
+    return '';
 }
 
 sub inline_deinitialize_slot {
@@ -185,9 +182,9 @@ Class::MOP::Instance - Instance Meta Object
 The meta instance is used by attributes for low level storage.
 
 Using this API generally violates attribute encapsulation and is not
-reccomended, instead look at L<Class::MOP::Attribute/get_value>,
-L<Class::MOP::Attribute/set_value> for the reccomended way to fiddle with
-attribute values in a generic way, independant of how/whether accessors have
+recommended, instead look at L<Class::MOP::Attribute/get_value>,
+L<Class::MOP::Attribute/set_value> for the recommended way to fiddle with
+attribute values in a generic way, independent of how/whether accessors have
 been defined. Accessors can be found using L<Class::MOP::Class/get_attribute>.
 
 This may seem like over-abstraction, but by abstracting
@@ -233,7 +230,7 @@ This too does just exactly what it says it does.
 
 =back
 
-=head2 Instrospection
+=head2 Introspection
 
 NOTE: There might be more methods added to this part of the API,
 we will add then when we need them basically.