bump version to 1.06
[gitmo/Class-MOP.git] / examples / ArrayBasedStorage.pod
index daf2eed..5c0369c 100644 (file)
@@ -17,13 +17,13 @@ sub new {
     my ($class, $meta, @attrs) = @_;
     my $self = $class->SUPER::new($meta, @attrs);
     my $index = 0;
-    $self->{'%!slot_index_map'} = { map { $_ => $index++ } $self->get_all_slots };
+    $self->{'slot_index_map'} = { map { $_ => $index++ } $self->get_all_slots };
     return $self;
 }
 
 sub create_instance {
     my $self = shift;
-    my $instance = $self->bless_instance_structure([]);
+    my $instance = bless [], $self->_class_name;
     $self->initialize_all_slots($instance);
     return $instance;
 }
@@ -35,7 +35,7 @@ sub clone_instance {
 
 # operations on meta instance
 
-sub get_slot_index_map { (shift)->{'%!slot_index_map'} }
+sub get_slot_index_map { (shift)->{'slot_index_map'} }
 
 sub initialize_slot {
     my ($self, $instance, $slot_name) = @_;
@@ -54,24 +54,26 @@ sub get_all_slots {
 
 sub get_slot_value {
     my ($self, $instance, $slot_name) = @_;
-    my $value = $instance->[ $self->{'%!slot_index_map'}->{$slot_name} ];
+    my $value = $instance->[ $self->{'slot_index_map'}->{$slot_name} ];
     return $value unless ref $value;
     refaddr $value eq refaddr $unbound ? undef : $value;
 }
 
 sub set_slot_value {
     my ($self, $instance, $slot_name, $value) = @_;
-    $instance->[ $self->{'%!slot_index_map'}->{$slot_name} ] = $value;
+    $instance->[ $self->{'slot_index_map'}->{$slot_name} ] = $value;
 }
 
 sub is_slot_initialized {
     my ($self, $instance, $slot_name) = @_;
     # NOTE: maybe use CLOS's *special-unbound-value* for this?
-    my $value = $instance->[ $self->{'%!slot_index_map'}->{$slot_name} ];
+    my $value = $instance->[ $self->{'slot_index_map'}->{$slot_name} ];
     return 1 unless ref $value;
     refaddr $value eq refaddr $unbound ? 0 : 1;
 }
 
+sub is_dependent_on_superclasses { 1 }
+
 1;
 
 __END__
@@ -121,7 +123,7 @@ Yuval Kogman E<lt>nothingmuch@woobling.comE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2006, 2007 by Infinity Interactive, Inc.
+Copyright 2006-2008 by Infinity Interactive, Inc.
 
 L<http://www.iinteractive.com>