Re: Using attributes for 'requires'

2009-01-19 Thread Darren Duncan
Yuval Kogman wrote (in private): 2009/1/19 Darren Duncan : So, any similar hacks to help with that, prior to Moose roles being smart enough to deal with this? with delegation you can just put the role after the attribute declaration: has foo => ( ..., handles => [qw(bar)] ); with 'Role::That

Re: Using attributes for 'requires'

2009-01-18 Thread Darren Duncan
benh wrote: so far the best hack is : sub location; has location => (...); Following this suggestion, I tried it myself (Moose 0.64, Class::MOP 0.75) to solve a related problem, where the auto-generated methods meant to satisfy a role's requirements are delegates to an attribute of the compo

Re: Using attributes for 'requires'

2009-01-18 Thread benh
so far the best hack is : sub location; has location => (...); On Sun, Jan 18, 2009 at 3:40 AM, Paul Fenwick wrote: > G'day Moosers, > > I'm currently working on some quick lightning talks demonstrating Moose and > why it's useful. One of the examples I'm using for roles looks like this: > >

Using attributes for 'requires'

2009-01-18 Thread Paul Fenwick
G'day Moosers, I'm currently working on some quick lightning talks demonstrating Moose and why it's useful. One of the examples I'm using for roles looks like this: package SunSmart; use Moose::Role; use Weather::Google; use constant HOT => 28; # Deg C.