|
Object::InsideOut v1.14 adds the capability to specify the return value for 'set' accessors. The default behavior of automatically generated set-type accessors is to return the value being set. Using the 'Return' keyword in the ':Field' attribute allows you to have the accessor return the old/previous value:
my @data :Field('Set' => 'set_data', 'Return' => 'Old');
or to return the object itself:
my @data :Field('Set' => 'set_data', 'Return' => 'Object');
The latter allows object method chaining:
$obj->set_data($data)->do_something(); |