B
Brian Buckley
The code below works but I do not understand the "(key, value)"
parenthesis syntax. I have not seen it before. Could someone
explain?
--Brian
(from Rails' active_support)
class Hash
def symbolize_keys
inject({}) do |options, (key, value)|
options[key.to_sym] = value
options
end
end
end
(above code from Rails' active_support)
parenthesis syntax. I have not seen it before. Could someone
explain?
--Brian
(from Rails' active_support)
class Hash
def symbolize_keys
inject({}) do |options, (key, value)|
options[key.to_sym] = value
options
end
end
end
(above code from Rails' active_support)