I have a simple array:
arr = [\"apples\", \"bananas\", \"coconuts\", \"watermelons\"]
I also have a function f that will perfo
f
h = arr.each_with_object({}) { |v,h| h[v] = f(v) }
This is what I would probably write:
h = Hash[arr.zip(arr.map(&method(:f)))]
Simple, clear, obvious, declarative. What more could you want?