=item B<init_arg>
+=item B<is_default_a_coderef>
+
=item B<default (?$instance)>
As noted in the documentation for C<new> above, if the I<default>
=back
+=over 4
+
+=item B<generate_accessor_method_inline>
+
+=item B<generate_predicate_method_inline>
+
+=item B<generate_reader_method_inline>
+
+=item B<generate_writer_method_inline>
+
+=back
+
=item B<remove_accessors>
This allows the attribute to remove the method for it's own
} 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;
This is currently only used by Class::MOP::Class::Immutable when performing
optimizations.
+=item B<inline_create_instance>
+
=item B<inline_slot_access ($instance_structure, $slot_name)>
=item B<inline_get_slot_value ($instance_structure, $slot_name)>
'... 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 {}');
use strict;
use warnings;
-use Test::More tests => 41;
+use Test::More tests => 46;
use Test::Exception;
BEGIN {
has_reader reader
has_predicate predicate
has_init_arg init_arg
- has_default default
+ has_default default is_default_a_coderef
slots
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