I started writing some methods and along the line for some reason I thought
it would be a good idea to have some flexibitily in the arguements that the
method would accept.
Basically, I could have a string, a list of strings, an array of strings,
or an array of AR Objects that the strings map to the name attribute.
this results in the ability to pass arguments like
( "one" )
("one", "two", "three" )
( ["one","two","three"]',["a string",[ object1, object2]] )
and so on
Basically I'm wondering if this is a good idea or should I make it a bit
more rigid in what arguments can be recieved.
My rule of thumb for the optimal amount of flexibility, in most cases,
would be whatever is consistent with duck typing -- that is, with
addressing the arguments uniformly and without branching on their
classes. That means I'd probably draw the line at the AR objects.
This approach tends to give you the most informative calling code,
because it does a reasonable amount of normalization up front. If
you're mixing everything, as in your third example, and depending on
the method to unjumble it, then when you look at your calling code you
have to hold in your head the fact that various mappings take place,
and that becomes harder later on when it's all less fresh in your