I defined a method that takes an Array (of Strings), like
def list(projects)
puts projects.join(', ')
end
list(['a', 'b'])
However, as a short-hand for calling it with an Array that only consists of a single String element, I'd like the same function to also accept a single plain String like
list('a')
What would be the Ruby way to handle this inside the method?
Array(projects).join(', ')