Posts tagged with "Ruby"

Ruby Local Method map Shortcut

In Ruby, we can pass blocks as directly as variables using &. This allows us to transform really simple map operations like this: arr.map{ |a| a.downcase } into this: arr.map(&:downcase) To me, the latter example is much cleaner, but there are some limitations:...