X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=examples%2FAttributesWithHistory.pod;h=e7ae1c26ac797298af47390118ead85bf72b8cfc;hb=f1af2436a0bc78cca31deb547233ef30983a2663;hp=6365e7908f31de7f281ffaceaa2b3bdf31f80327;hpb=c23184fc39306590f9e481d76c199020a638bb28;p=gitmo%2FClass-MOP.git diff --git a/examples/AttributesWithHistory.pod b/examples/AttributesWithHistory.pod index 6365e79..e7ae1c2 100644 --- a/examples/AttributesWithHistory.pod +++ b/examples/AttributesWithHistory.pod @@ -12,7 +12,7 @@ use base 'Class::MOP::Attribute'; # this is for an extra attribute constructor # option, which is to be able to create a # way for the class to access the history -AttributesWithHistory->meta->add_attribute('$!history_accessor' => ( +AttributesWithHistory->meta->add_attribute('history_accessor' => ( reader => 'history_accessor', init_arg => 'history_accessor', predicate => 'has_history_accessor', @@ -20,7 +20,7 @@ AttributesWithHistory->meta->add_attribute('$!history_accessor' => ( # this is a place to store the actual # history of the attribute -AttributesWithHistory->meta->add_attribute('$!_history' => ( +AttributesWithHistory->meta->add_attribute('_history' => ( accessor => '_history', default => sub { {} }, )); @@ -31,7 +31,7 @@ AttributesWithHistory->meta->add_after_method_modifier('install_accessors' => su my ($self) = @_; # and now add the history accessor $self->associated_class->add_method( - $self->process_accessors('history_accessor' => $self->history_accessor()) + $self->_process_accessors('history_accessor' => $self->history_accessor()) ) if $self->has_history_accessor(); }); @@ -47,7 +47,7 @@ use base 'Class::MOP::Method::Accessor'; # generate the methods -sub generate_history_accessor_method { +sub _generate_history_accessor_method { my $attr_name = (shift)->associated_attribute->name; eval qq{sub { unless (ref \$_[0]->meta->get_attribute('$attr_name')->_history()->\{\$_[0]\}) \{ @@ -57,7 +57,7 @@ sub generate_history_accessor_method { }}; } -sub generate_accessor_method { +sub _generate_accessor_method { my $attr_name = (shift)->associated_attribute->name; eval qq{sub { if (scalar(\@_) == 2) { @@ -71,7 +71,7 @@ sub generate_accessor_method { }}; } -sub generate_writer_method { +sub _generate_writer_method { my $attr_name = (shift)->associated_attribute->name; eval qq{sub { unless (ref \$_[0]->meta->get_attribute('$attr_name')->_history()->\{\$_[0]\}) \{ @@ -126,7 +126,7 @@ Yuval Kogman Enothingmuch@woobling.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006 by Infinity Interactive, Inc. +Copyright 2006-2008 by Infinity Interactive, Inc. L