X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=examples%2FArrayBasedStorage.pod;h=bc5a19b9ddc87008b65f79c58db7b8dc835667d3;hb=56e8dd5d8cb94bc16d5f663e436aa41178b0dc7d;hp=1f040122c1dfd5ed1aa7761cbe0cf588c7cffdf9;hpb=43715282bcc431ac51dc795d98ab3433a9893aaa;p=gitmo%2FClass-MOP.git diff --git a/examples/ArrayBasedStorage.pod b/examples/ArrayBasedStorage.pod index 1f04012..bc5a19b 100644 --- a/examples/ArrayBasedStorage.pod +++ b/examples/ArrayBasedStorage.pod @@ -24,13 +24,18 @@ sub create_instance { $self->bless_instance_structure([]); } +sub clone_instance { + my ($self, $instance) = shift; + $self->bless_instance_structure([ @$instance ]); +} + # operations on meta instance sub get_slot_index_map { (shift)->{slot_index_map} } sub get_all_slots { my $self = shift; - return sort @{$self->{slots}}; + return sort $self->SUPER::get_all_slots; } sub get_slot_value { @@ -43,11 +48,6 @@ sub set_slot_value { $instance->[ $self->{slot_index_map}->{$slot_name} ] = $value; } -sub initialize_slot { - my ($self, $instance, $slot_name) = @_; - $instance->[ $self->{slot_index_map}->{$slot_name} ] = undef; -} - sub is_slot_initialized { # NOTE: # maybe use CLOS's *special-unbound-value* @@ -94,10 +94,12 @@ This is very similar now to the InsideOutClass example, and in fact, they both share the exact same test suite, with the only difference being the Instance metaclass they use. -=head1 AUTHOR +=head1 AUTHORS Stevan Little Estevan@iinteractive.comE +Yuval Kogman Enothingmuch@woobling.comE + =head1 SEE ALSO =head1 COPYRIGHT AND LICENSE