my $meta_instance = $self->associated_class->instance_metaclass;
my $code = eval 'sub {'
- . $meta_instance->inline_set_slot_value('$_[0]', $attr_name, '$_[1]') . ' if scalar(@_) == 2; '
- . $meta_instance->inline_get_slot_value('$_[0]', $attr_name)
+ . $meta_instance->inline_set_slot_value('$_[0]', "'$attr_name'", '$_[1]') . ' if scalar(@_) == 2; '
+ . $meta_instance->inline_get_slot_value('$_[0]', "'$attr_name'")
. '}';
confess "Could not generate inline accessor because : $@" if $@;
my $code = eval 'sub {'
. 'confess "Cannot assign a value to a read-only accessor" if @_ > 1;'
- . $meta_instance->inline_get_slot_value('$_[0]', $attr_name)
+ . $meta_instance->inline_get_slot_value('$_[0]', "'$attr_name'")
. '}';
confess "Could not generate inline accessor because : $@" if $@;
my $meta_instance = $self->associated_class->instance_metaclass;
my $code = eval 'sub {'
- . $meta_instance->inline_set_slot_value('$_[0]', $attr_name, '$_[1]')
+ . $meta_instance->inline_set_slot_value('$_[0]', "'$attr_name'", '$_[1]')
. '}';
confess "Could not generate inline accessor because : $@" if $@;
my $meta_instance = $self->associated_class->instance_metaclass;
my $code = eval 'sub {'
- . 'defined ' . $meta_instance->inline_get_slot_value('$_[0]', $attr_name) . ' ? 1 : 0'
+ . 'defined ' . $meta_instance->inline_get_slot_value('$_[0]', "'$attr_name'") . ' ? 1 : 0'
. '}';
confess "Could not generate inline accessor because : $@" if $@;
if (reftype($accessor)) {
(reftype($accessor) eq 'HASH')
|| confess "bad accessor/reader/writer/predicate format, must be a HASH ref";
- my ($name, $method) = each %{$accessor};
+ my ($name, $method) = %{$accessor};
return ($name, Class::MOP::Attribute::Accessor->wrap($method));
}
else {
=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