From: Matt S Trout Date: Mon, 18 Mar 2019 04:43:33 +0000 (+0000) Subject: extract _expand_bool method X-Git-Tag: v1.90_01~366 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=05d37f9c28a43798b3ff8b67af966b57109eb6d3;p=dbsrgits%2FSQL-Abstract.git extract _expand_bool method --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index dd5544f..cb2c157 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -195,14 +195,7 @@ sub new { -ident => '_expand_ident', -value => '_expand_value', -not => '_expand_not', - -bool => sub { - my ($self, undef, $v) = @_; - if (ref($v)) { - return $self->_expand_expr($v); - } - puke "-bool => undef not supported" unless defined($v); - return $self->_expand_ident(-ident => $v); - }, + -bool => '_expand_bool', }; return bless \%opt, $class; @@ -925,6 +918,15 @@ sub _expand_not { +{ -op => [ 'not', $_[0]->_expand_expr($_[2]) ] }; } +sub _expand_bool { + my ($self, undef, $v) = @_; + if (ref($v)) { + return $self->_expand_expr($v); + } + puke "-bool => undef not supported" unless defined($v); + return $self->_expand_ident(-ident => $v); +} + sub _recurse_where { my ($self, $where, $logic) = @_;