sub generate_predicate {
my $attribute = shift;
- my $key = $attribute->name;
+ my $key = $attribute->inlined_name;
- my $predicate = 'sub { exists($_[0]->{$key}) }';
+ my $predicate = 'sub { exists($_[0]->{'.$key.'}) }';
my $sub = eval $predicate;
confess $@ if $@;
sub generate_clearer {
my $attribute = shift;
- my $key = $attribute->name;
+ my $key = $attribute->inlined_name;
- my $clearer = 'sub { delete($_[0]->{$key}) }';
+ my $clearer = 'sub { delete($_[0]->{'.$key.'}) }';
my $sub = eval $clearer;
confess $@ if $@;