From: Matt S Trout Date: Sat, 1 Dec 2012 21:04:26 +0000 (+0000) Subject: break out base class construction X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a60d973aae9467a8afbccbde197423ec31e86bc8;p=dbsrgits%2FSQL-Abstract.git break out base class construction --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index f7b3986..3a2bead 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -110,9 +110,20 @@ has renderer_class => ( after clear_renderer_class => sub { shift->clear_renderer }; sub _build_renderer_class { + my ($self) = @_; + my ($class, @roles) = ( + $self->_build_base_renderer_class, $self->_build_renderer_roles + ); + return $class unless @roles; + return use_module('Moo::Role')->create_class_with_roles($class, @roles); +} + +sub _build_base_renderer_class { use_module('Data::Query::Renderer::SQL::Naive') } +sub _build_renderer_roles { () } + sub _converter_args { my ($self) = @_; Scalar::Util::weaken($self);