aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/hash/reverse_merge.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb b/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb
index a82cdfc360..87a7bebd7b 100644
--- a/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb
+++ b/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb
@@ -6,14 +6,14 @@ class Hash
# options.reverse_merge! :size => 25, :velocity => 10
# end
#
- # Using <tt>merge</tt>, the above example would look as follows:
+ # The default <tt>:size</tt> and <tt>:velocity</tt> are only set if the +options+ hash passed in doesn't already
+ # have the respective key.
+ #
+ # As contrast, using Ruby's built in <tt>merge</tt> would require writing the following:
#
# def setup(options = {})
- # { :size => 25, :velocity => 10 }.merge(options)
+ # options = { :size => 25, :velocity => 10 }.merge(options)
# end
- #
- # The default <tt>:size</tt> and <tt>:velocity</tt> are only set if the +options+ hash passed in doesn't already
- # have the respective key.
def reverse_merge(other_hash)
other_hash.merge(self)
end