It happens often that you need an array as object type, and even if you have defined your API like that, you still want to double check that the parameter received in your method is an array:
Fortunalety in ruby you have the following feature that converts your parameter to an array, or does nothing in case it is already an array:
This feature does not exist in python, or I haven’t found it though.
The following snippet covers that funcionality:
Example:
You can check the behavior with the following chunk of unit tests: