if (my $pred = $spec->{predicate}) {
$methods{$pred} =
quote_sub "${into}::${pred}" =>
- ' '.$self->_generate_simple_has('$_[0]', $name)."\n"
+ ' '.$self->_generate_simple_has('$_[0]', $name, $spec)."\n"
;
}
if (my $cl = $spec->{clearer}) {
$methods{$cl} =
quote_sub "${into}::${cl}" =>
- $self->_generate_simple_clear('$_[0]', $name)."\n"
+ $self->_generate_simple_clear('$_[0]', $name, $spec)."\n"
;
}
if (my $hspec = $spec->{handles}) {
sub _generate_get {
my ($self, $name, $spec) = @_;
- my $simple = $self->_generate_simple_get('$_[0]', $name);
+ my $simple = $self->_generate_simple_get('$_[0]', $name, $spec);
if ($self->is_simple_get($name, $spec)) {
$simple;
} else {
'do { '.$self->_generate_use_default(
'$_[0]', $name, $spec,
- $self->_generate_simple_has('$_[0]', $name),
+ $self->_generate_simple_has('$_[0]', $name, $spec),
).'; '.$simple.' }';
}
}
.($spec->{trigger}
? ' '
.$self->_generate_trigger(
- $name, $me, $self->_generate_simple_get($me, $name),
+ $name, $me, $self->_generate_simple_get($me, $name, $spec),
$spec->{trigger}
)." if ${test};\n"
: ''
.($spec->{trigger}
? " "
.$self->_generate_trigger(
- $name, $me, $self->_generate_simple_get($me, $name),
+ $name, $me, $self->_generate_simple_get($me, $name, $spec),
$spec->{trigger}
).";\n"
: ""
join '', (
@init
? ' '.$self->_cap_call($ag->generate_multi_set(
- '$new', [ @slots ], '@{$args}{qw('.join(' ',@init).')}'
+ '$new', [ @slots ], '@{$args}{qw('.join(' ',@init).')}', $spec
)).";\n"
: ''
), map {
my ($init, $trigger) = @{$spec->{$name}}{qw(init_arg trigger)};
next unless $init && $trigger;
my ($code, $add_captures) = $acc->generate_trigger(
- $name, '$new', $acc->generate_simple_get('$new', $name), $trigger
+ $name, '$new', $acc->generate_simple_get('$new', $name, $spec), $trigger
);
@{$captures}{keys %$add_captures} = values %$add_captures;
$fire .= " ${code} if exists \$args->{${\perlstring $init}};\n";