On Fri, 13 Jan 2012, Mark Hedges wrote:
> On Thu, 12 Jan 2012, Dave Rolsky wrote: > > > It seems to me that this would be better written like this: > > > > package Machine; > > use Moose; > > > > has power_cycler => ( > > is => 'ro', > > does => 'PowerCycler', > > handles => [ 'restart' ], > > ); I guess this is not too difficult. The builder for the attribute will get the hardware type and pick the right class, which consumes the parent role specified in 'does'. In some ways maybe it is better, because if I have other hardware-ish methods they can be organized in separate utility object classes. Mark
