This is for an already existing public API that I cannot break, but I do wish to extend.
Currently the method takes a string or a symbol or anything else that makes sense when passed as the first parameter to send
I'd like to add the ability to send a list of strings, symbols, et cetera. I could just use is_a? Array
, but there are other ways of sending lists, and that's not very ruby-ish.
I'll be calling map
on the list, so the first inclination is to use respond_to? :map
. But a string also responds to :map
, so that won't work.