What Enumerable
method is this code inadvertently reimplementing?
def string_lengths(strings)
lengths = {}
strings.each do |string|
lengths[string] = string.length
end
lengths
end
# string_lengths(%w(ben chris mark)) =>
# { "ben" => 3, "chris" => 5, "mark" => 4 }