On Aug 3, 2010, at 4:21 AM, Brian ROONEY wrote:
Thanks Nick,
It's actually the delegation of the helpers for CodeRef i'm unsure
how to use since they are wrapped in the Hash, I would imagine I
would have to use some API call similar to what 'handles' does to
pull the execute() and execute_method() method modifiers in
Moose::Meta::Attribute::Native::Trait::Code into my class each time
a new item is added to the Hash.
sub my_set_actions {
my ($self)=...@_;
# allocate new CodeRef
# add it to the Hash
# do some api call to load the method modifiers in
Moose::Meta::Attribute::Native::Trait::Code
# into $self (with unique method names of course)
$self->set_actions('Baz', $coderef )
}
No, there is no support for this in plain Moose. However, I suspect it
could be accomplished with a bit of metaprogramming.
Can you be more clear about what it is you want it to actually do in
the end? At this point I am not quite sure what you are looking for in
terms of an API to call the coderefs in your hash, and why $obj-
>get_action('Foo')->() is not sufficient.
- Stevan