# GLOBALS
#======================================================================
-our $VERSION = '1.87';
+our $VERSION = '1.90_01';
# This would confuse some packagers
$VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases
s/\A\s+//, s/\s+\Z// for $sql;
return [ $sql, @bind ];
};
+ $opt{expand_op}{ident} = __PACKAGE__->make_unop_expander(sub {
+ my ($self, undef, $body) = @_;
+ $body = $body->from if Scalar::Util::blessed($body);
+ $self->_expand_ident(ident => $body);
+ });
}
}
sub plugin {
my ($self, $plugin, @args) = @_;
unless (ref $plugin) {
- $plugin =~ s/\A\+/${\ref($self)}::Plugin::/;
+ $plugin =~ s/\A\+/${\__PACKAGE__}::Plugin::/;
require(join('/', split '::', $plugin).'.pm');
}
$plugin->apply_to($self, @args);
my $name = join '_', reverse split '_', $type;
my $singular = "${type}er";
- eval qq{sub ${singular} { shift->${singular}s(\@_) }; 1 }
- or die "Method builder failed for ${singular}: $@";
+ eval qq{sub ${singular} {
+ my \$self = shift;
+ return \$self->_ext_rw('${name}', \@_) if \@_ == 1;
+ return \$self->${singular}s(\@_)
+ }; 1 } or die "Method builder failed for ${singular}: $@";
eval qq{sub wrap_${singular} {
shift->wrap_${singular}s(\@_)
}; 1 } or die "Method builder failed for wrap_${singular}: $@";
sub _expand_list {
my ($self, undef, $expr) = @_;
return { -op => [
- ',', map $self->expand_expr($_),
+ ',', map $self->expand_expr($_),
@{$expr->{-op}}[1..$#{$expr->{-op}}]
] } if ref($expr) eq 'HASH' and ($expr->{-op}||[''])->[0] eq ',';
return +{ -op => [ ',',