Revision history for Perl extension Class-MOP.
+NEXT
+ * Class::MOP::Attribute
+ - add has_read_method and has_write_method
+
0.55 Mon. April 28, 2008
- All classes now have proper C3 MRO support
- added MRO::Compat as a dependency to allow
# end bootstrapped away method section.
# (all methods below here are kept intact)
+sub has_read_method { $_[0]->has_reader || $_[0]->has_accessor }
+sub has_write_method { $_[0]->has_writer || $_[0]->has_accessor }
+
sub get_read_method {
my $self = shift;
my $reader = $self->reader || $self->accessor;
NOTE: If no reader/writer/accessor was specified, this will use the
attribute get_value/set_value methods, which can be very inefficient.
+=item B<has_read_method>
+
+=item B<has_write_method>
+
+Return whether a method exists suitable for reading / writing the value
+of the attribute in the associated class. Suitable for use whether
+C<reader> and C<writer> or C<accessor> was used.
+
=back
=head2 Informational predicates