To do the equivalent of Python list comprehensions, I\'m doing the following:
some_array.select{|x| x % 2 == 0 }.collect{|x| x * 3}
Is ther
Ruby 2.7 introduced filter_map which pretty much achieves what you want (map + compact):
filter_map
some_array.filter_map { |x| x * 3 if x % 2 == 0 }
You can read more about it here.