Moose のドキュメントによると、オブジェクトthing
に簡単に委譲できるとのことです。
has 'thing' => (
...
handles => { set_foo => [ set => 'foo' ] },
);
# $self->set_foo(...) calls $self->thing->set('foo', ...)
しかし、私は本当に物のオブジェクト、特にdatetimeオブジェクトに委任したい
has 'thing' => (
...
handles => {
get_month => { datetime ... },
},
);
# $self->get_month calls $self->thing->datetime->month;
これを行うには、どのようにハンドルを作成する必要がありますか?