aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRashmi Yadav <rays.rashmi@gmail.com>2013-09-13 19:09:10 +0200
committerRashmi Yadav <rays.rashmi@gmail.com>2013-09-13 19:09:10 +0200
commit361eea79999b5ad298be80a39766748b2a04258c (patch)
tree477fe4139783176a4333024c916e41c9493e2b55
parente4d6a61cd62911af2d85f8d899bb3cbaeeb38574 (diff)
downloadrails-361eea79999b5ad298be80a39766748b2a04258c.tar.gz
rails-361eea79999b5ad298be80a39766748b2a04258c.tar.bz2
rails-361eea79999b5ad298be80a39766748b2a04258c.zip
Removed doc of diff method [ci skip]
-rw-r--r--guides/source/active_support_core_extensions.md38
1 files changed, 0 insertions, 38 deletions
diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md
index 08a95f3fd9..d3f49b19fa 100644
--- a/guides/source/active_support_core_extensions.md
+++ b/guides/source/active_support_core_extensions.md
@@ -2673,44 +2673,6 @@ hash[:b][:d] == [3, 4] # => true
NOTE: Defined in `active_support/core_ext/object/deep_dup.rb`.
-### Diffing
-
-The method `diff` returns a hash that represents a diff of the receiver and the argument with the following logic:
-
-* Pairs `key`, `value` that exist in both hashes do not belong to the diff hash.
-
-* If both hashes have `key`, but with different values, the pair in the receiver wins.
-
-* The rest is just merged.
-
-```ruby
-{a: 1}.diff(a: 1)
-# => {}, first rule
-
-{a: 1}.diff(a: 2)
-# => {:a=>1}, second rule
-
-{a: 1}.diff(b: 2)
-# => {:a=>1, :b=>2}, third rule
-
-{a: 1, b: 2, c: 3}.diff(b: 1, c: 3, d: 4)
-# => {:a=>1, :b=>2, :d=>4}, all rules
-
-{}.diff({}) # => {}
-{a: 1}.diff({}) # => {:a=>1}
-{}.diff(a: 1) # => {:a=>1}
-```
-
-An important property of this diff hash is that you can retrieve the original hash by applying `diff` twice:
-
-```ruby
-hash.diff(hash2).diff(hash2) == hash
-```
-
-Diffing hashes may be useful for error messages related to expected option hashes for example.
-
-NOTE: Defined in `active_support/core_ext/hash/diff.rb`.
-
### Working with Keys
#### `except` and `except!`