my $attr = $self->associated_attribute;
my $code = try {
- $self->_compile_code(
- source => [
- 'sub {',
- $attr->inline_set( '$_[0]', '$_[1]' )
- . ' if scalar(@_) == 2;',
- $attr->inline_get('$_[0]') . ';',
- '}',
- ]
- );
+ $self->_compile_code([
+ 'sub {',
+ $attr->inline_set('$_[0]', '$_[1]'),
+ 'if scalar(@_) == 2;',
+ $attr->inline_get('$_[0]') . ';',
+ '}',
+ ]);
}
catch {
confess "Could not generate inline accessor because : $_";
my $attr = $self->associated_attribute;
my $code = try {
- $self->_compile_code(
- source => [
- 'sub {',
- 'confess "Cannot assign a value to a read-only accessor" '
- . 'if @_ > 1;',
- $attr->inline_get('$_[0]') . ';',
- '}',
- ],
- );
+ $self->_compile_code([
+ 'sub {',
+ 'confess "Cannot assign a value to a read-only accessor"',
+ 'if @_ > 1;',
+ $attr->inline_get('$_[0]') . ';',
+ '}',
+ ]);
}
catch {
confess "Could not generate inline reader because : $_";
my $attr = $self->associated_attribute;
my $code = try {
- $self->_compile_code(
- source => [
- 'sub {',
- $attr->inline_set( '$_[0]', '$_[1]' ) . ';',
- '}',
- ],
- );
+ $self->_compile_code([
+ 'sub {',
+ $attr->inline_set('$_[0]', '$_[1]') . ';',
+ '}',
+ ]);
}
catch {
confess "Could not generate inline writer because : $_";
my $attr = $self->associated_attribute;
my $code = try {
- $self->_compile_code(
- source => [
- 'sub {',
- $attr->inline_has('$_[0]') . ';',
- '}',
- ],
- );
+ $self->_compile_code([
+ 'sub {',
+ $attr->inline_has('$_[0]') . ';',
+ '}',
+ ]);
}
catch {
confess "Could not generate inline predicate because : $_";
my $attr = $self->associated_attribute;
my $code = try {
- $self->_compile_code(
- source => [
- 'sub {',
- $attr->inline_clear('$_[0]') . ';',
- '}',
- ],
- );
+ $self->_compile_code([
+ 'sub {',
+ $attr->inline_clear('$_[0]') . ';',
+ '}',
+ ]);
}
catch {
confess "Could not generate inline clearer because : $_";