Actions
Feature #9778
closedBring shortcut methods to Hash
Description
My obsession with easy syntax annoys me when I see Hash#merge
does not have a shortcut in the form of a mathematical operation (like -
or +
).
h_one = { :foo => "bar", :this => "that", :all => "nothing" }
h_two = { :foo => "this", :ruby => "awesome" }
# this isn't as pretty
h_one.merge(h_two)
=> { :foo => "this", :this => "that", :all => "nothing", :ruby => "awesome" }
# as this
h_one+h_two
=> { :foo => "this", :this => "that", :all => "nothing", :ruby => "awesome" }`
Why doesn't this exist in Ruby?
Updated by bitsweat (Jeremy Daer) over 10 years ago
Updated by nobu (Nobuyoshi Nakada) over 10 years ago
- Description updated (diff)
Updated by nobu (Nobuyoshi Nakada) over 10 years ago
- Related to Feature #6225: Hash#+ added
Updated by nobu (Nobuyoshi Nakada) over 10 years ago
- Related to deleted (Feature #6225: Hash#+)
Updated by nobu (Nobuyoshi Nakada) over 10 years ago
- Is duplicate of Feature #6225: Hash#+ added
Updated by nobu (Nobuyoshi Nakada) over 10 years ago
- Status changed from Open to Rejected
Actions
Like0
Like0Like0Like0Like0Like0Like0