How can you pass a function by name in Ruby? (I've only been using Ruby for a few hours, so I'm still figuring things out.)
nums = [1, 2, 3, 4]
# This works, but is more verbose than I'd like
nums.each do |i|
puts i
end
# In JS, I could just do something like:
# nums.forEach(console.log)
# In F#, it would be something like:
# List.iter nums (printf "%A")
# In Ruby, I wish I could do something like:
nums.each puts
Can it be done similarly concisely in Ruby? Can I just reference the function by name instead of using a block?
People voting to close: Can you explain why this isn't a real question?