$default = '$instance->'.$attr->builder;
}
- if ( defined(my $init_arg = $attr->init_arg) ) {
- return (
- 'if(exists $params->{\'' . $init_arg . '\'}){' . "\n" .
- $self->_meta_instance->inline_set_slot_value(
- '$instance',
- $attr->name,
- '$params->{\'' . $init_arg . '\'}' ) . "\n" .
- '} ' . (!defined $default ? '' : 'else {' . "\n" .
- $self->_meta_instance->inline_set_slot_value(
+ if ( defined( my $init_arg = $attr->init_arg ) ) {
+ return (
+ 'if(exists $params->{\''
+ . $init_arg . '\'}){' . "\n"
+ . $self->_meta_instance->inline_set_slot_value(
+ '$instance',
+ $attr->name,
+ '$params->{\'' . $init_arg . '\'}'
+ )
+ . "\n" . '} '
+ . (
+ !defined $default ? '' : 'else {' . "\n"
+ . $self->_meta_instance->inline_set_slot_value(
'$instance',
$attr->name,
- $default ) . "\n" .
- '}')
+ $default
+ )
+ . "\n" . '}'
+ )
);
- } elsif ( defined $default ) {
+ }
+ elsif ( defined $default ) {
return (
$self->_meta_instance->inline_set_slot_value(
'$instance',
$attr->name,
- $default ) . "\n"
+ $default
+ )
+ . "\n"
);
- } else { return '' }
+ }
+ else {
+ return '';
+ }
}
sub _generate_default_value {