Bump us up to 0.64
[gitmo/Class-MOP.git] / lib / Class / MOP / Instance.pm
index 3eae0c1..fb0dca1 100644 (file)
@@ -6,13 +6,10 @@ use warnings;
 
 use Scalar::Util 'weaken', 'blessed';
 
-our $VERSION   = '0.04';
+our $VERSION   = '0.64';
 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) = @_;
@@ -180,26 +177,15 @@ __END__
 
 Class::MOP::Instance - Instance Meta Object
 
-=head1 SYNOPSIS
-
-  # for the most part, this protocol is internal
-  # and not for public usage, but this how one
-  # might use it
-
-  package Foo;
-
-  use strict;
-  use warnings;
-  use metaclass (
-      ':instance_metaclass'  => 'ArrayBasedStorage::Instance',
-  );
-
-  # now Foo->new produces blessed ARRAY ref based objects
-
 =head1 DESCRIPTION
 
-This is a sub-protocol which governs instance creation
-and access to the slots of the instance structure.
+The meta instance is used by attributes for low level storage.
+
+Using this API generally violates attribute encapsulation and is not
+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
 this process into a sub-protocol we make it possible to
@@ -240,9 +226,11 @@ This does just exactly what it says it does.
 
 =item B<clone_instance ($instance_structure)>
 
+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.
@@ -251,6 +239,8 @@ we will add then when we need them basically.
 
 =item B<associated_metaclass>
 
+This returns the metaclass associated with this instance.
+
 =item B<get_all_slots>
 
 This will return the current list of slots based on what was
@@ -258,6 +248,8 @@ given to this object in C<new>.
 
 =item B<is_valid_slot ($slot_name)>
 
+This will return true if C<$slot_name> is a valid slot name.
+
 =back
 
 =head2 Operations on Instance Structures
@@ -267,6 +259,10 @@ instance meta-object is a different entity from the actual
 instance it creates. For this reason, any actions on slots
 require that the C<$instance_structure> is passed into them.
 
+The names of these methods pretty much explain exactly 
+what they do, if that is not enough then I suggest reading 
+the source, it is very straightfoward.
+
 =over 4
 
 =item B<get_slot_value ($instance_structure, $slot_name)>
@@ -293,19 +289,13 @@ require that the C<$instance_structure> is passed into them.
 
 =head2 Inlineable Instance Operations
 
-This part of the API is currently un-used. It is there for use
-in future experiments in class finailization mostly. Best to
-ignore this for now.
-
 =over 4
 
 =item B<is_inlinable>
 
 Each meta-instance should override this method to tell Class::MOP if it's
-possible to inline the slot access.
-
-This is currently only used by Class::MOP::Class::Immutable when performing
-optimizations.
+possible to inline the slot access. This is currently only used by 
+L<Class::MOP::Immutable> when performing optimizations.
 
 =item B<inline_create_instance>