From: Stevan Little Date: Wed, 5 Jul 2006 15:47:10 +0000 (+0000) Subject: cleanup X-Git-Tag: 0_33~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=495af5181ab3a346f2271c3b1a981e355941e2c4;p=gitmo%2FClass-MOP.git cleanup --- diff --git a/lib/Class/MOP/Attribute.pm b/lib/Class/MOP/Attribute.pm index 718436f..c4c0d6b 100644 --- a/lib/Class/MOP/Attribute.pm +++ b/lib/Class/MOP/Attribute.pm @@ -492,6 +492,8 @@ passed into C. I think they are pretty much self-explanitory. =item B +=item B + =item B As noted in the documentation for C above, if the I @@ -576,6 +578,18 @@ use the custom method passed through the constructor. =back +=over 4 + +=item B + +=item B + +=item B + +=item B + +=back + =item B This allows the attribute to remove the method for it's own diff --git a/lib/Class/MOP/Class/Immutable.pm b/lib/Class/MOP/Class/Immutable.pm index cd066cf..a94a12b 100644 --- a/lib/Class/MOP/Class/Immutable.pm +++ b/lib/Class/MOP/Class/Immutable.pm @@ -93,7 +93,7 @@ sub _generate_inline_constructor { } 0 .. (@$attrs - 1)); $source .= ";\n" . 'return $instance'; $source .= ";\n" . '}'; - warn $source; + warn $source if $options->{debug}; my $code = eval $source; confess "Could not eval the constructor :\n\n$source\n\nbecause :\n\n$@" if $@; return $code; diff --git a/lib/Class/MOP/Instance.pm b/lib/Class/MOP/Instance.pm index 23be56a..4f56213 100644 --- a/lib/Class/MOP/Instance.pm +++ b/lib/Class/MOP/Instance.pm @@ -271,6 +271,8 @@ possible to inline the slot access. This is currently only used by Class::MOP::Class::Immutable when performing optimizations. +=item B + =item B =item B diff --git a/t/010_self_introspection.t b/t/010_self_introspection.t index 685f924..4595302 100644 --- a/t/010_self_introspection.t +++ b/t/010_self_introspection.t @@ -217,7 +217,7 @@ is($class_mop_class_meta->get_attribute('%:attributes')->init_arg, '... Class::MOP::Class %:attributes\'s a init_arg is :attributes'); ok($class_mop_class_meta->get_attribute('%:attributes')->has_default, '... Class::MOP::Class %:attributes has a default'); -is_deeply($class_mop_class_meta->get_attribute('%:attributes')->default, +is_deeply($class_mop_class_meta->get_attribute('%:attributes')->default('Foo'), {}, '... Class::MOP::Class %:attributes\'s a default of {}'); diff --git a/t/014_attribute_introspection.t b/t/014_attribute_introspection.t index bb4af65..ec11f79 100644 --- a/t/014_attribute_introspection.t +++ b/t/014_attribute_introspection.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 41; +use Test::More tests => 46; use Test::Exception; BEGIN { @@ -31,7 +31,7 @@ BEGIN { has_reader reader has_predicate predicate has_init_arg init_arg - has_default default + has_default default is_default_a_coderef slots @@ -43,6 +43,11 @@ BEGIN { generate_writer_method generate_predicate_method + generate_accessor_method_inline + generate_reader_method_inline + generate_writer_method_inline + generate_predicate_method_inline + process_accessors install_accessors remove_accessors