aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support.rb
diff options
context:
space:
mode:
authorLeo Cassarani <leo.cassarani@me.com>2012-09-03 23:13:49 +0100
committerLeo Cassarani <leo.cassarani@me.com>2012-09-05 00:59:29 +0100
commitedab820d9ee5c18780e11752d46d7df73c820ddb (patch)
treefbe62a00a861fc9fcd1338b48df9df96da4e3c0e /activesupport/lib/active_support.rb
parent7995c03dc0e8ff8448427de16c98f77aa8bb6a01 (diff)
downloadrails-edab820d9ee5c18780e11752d46d7df73c820ddb.tar.gz
rails-edab820d9ee5c18780e11752d46d7df73c820ddb.tar.bz2
rails-edab820d9ee5c18780e11752d46d7df73c820ddb.zip
Extend HashWithIndifferentAccess#update to take an optional block
When a block is passed into the method, it will be invoked for each duplicated key, with the key in question and the two values as arguments. The value for the duplicated key in the receiver will be set to the return value of the block. This behaviour matches Ruby's long-standing implementation of Hash#update and is intended to provide a more consistent interface. HashWithIndifferentAccess#merge is also affected by the change, as it uses #update internally.
Diffstat (limited to 'activesupport/lib/active_support.rb')
0 files changed, 0 insertions, 0 deletions