最佳答案
为了完成类似于 Python 列表理解的操作,我将执行以下操作:
some_array.select{|x| x % 2 == 0 }.collect{|x| x * 3}
有没有更好的方法来做到这一点... 也许用一个方法调用?