by dlisboa · 1y ago · 0 comments
if x.is_a? Array
x = x.first
Or something like that. Could be one line too: x = x.first if x.is_a? ArrayEven if you implement an "interface" (duck typing) with `respond_to?(:to_app_version)` you still can't be sure that the return type of this `:to_app_version` is actually a string you can call `split()` on.