Object-InsideOut - Argument passing and parsing

Posted on Thu Oct 5 15:40:24 2006 by nikc
Argument passing and parsing

This is either a feature request or a "show me the docs I've missed" request. I'm not sure which yet :-)

Does Object::InsideOut provide any support for writing methods that support the same parameter passing style as the constructor?

E.g., where the docs have:

my $obj = My::Class->new('param1' => 'value1'); # or my $obj = My::Class->new({'param1' => 'value1'}); # or even my $obj = My::Class->new( 'param_X' => 'value_X', 'param_Y' => 'value_Y', { 'param_A' => 'value_A', 'param_B' => 'value_B', }, { 'param_Q' => 'value_Q', }, );

I'd like to write my own method that supports the same parameter passing style. I can use similar code to that found in Object::InsideOut::new(), but it would be nice if I could decorate a sub declaration with an attribute that would give me that functionality 'for free', without needing to duplicate code in several places.

Let me know if you'd like me to submit this via RT.

Direct Responses: 3207 | Write a response