README.md in hash_diff-0.5.1 vs README.md in hash_diff-0.6.0

- old
+ new

@@ -64,9 +64,32 @@ ```ruby hash_diff.right_diff # => { foo: "bar", bar: "foo", nested: { foo: "bar", bar: { one: "foo1", two: nil } }, num: 1, word: nil } ``` +You can also use these shorthand methods + +```ruby + HashDiff.diff(left, right) + HashDiff.left_diff(left, right) + HashDiff.right_diff(left, right) +``` + +Hash#diff is not provided by default, and monkey patching is frowned upon by some, but to provide a one way shorthand, use the following code snippet. + +```ruby + class Hash + def diff(right) + HashDiff.right_diff(self, right) + end + end + + left = { foo: 'bar', num: 1 } + right = { foo: 'baz', num: 1 } + + left.diff(right) # => { foo: 'baz' } +``` + ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`)