As an aside, I don't like the long `if/elsif/else` statement. I'd prefer:
```ruby
case argument
when *TYPE_WHITELIST
  argument
when Hash
  # ...
when Array
  # ...
else
  raise # ...
end
```
But sadly that doesn't work with the initial `respond_to?` check.