面试题答案
一键面试def generate_file_path(filename, os)
case os
when 'windows'
'C:\\' + filename.gsub('/', '\\')
when 'linux','macos'
'/' + filename.gsub('\\', '/')
else
raise ArgumentError, "Unsupported operating system: #{os}"
end
end