README.md in hashdiff-0.1.0 vs README.md in hashdiff-0.1.1

- old
+ new

@@ -1,6 +1,6 @@ -# HashDiff [![Build Status](https://secure.travis-ci.org/liufengyun/hashdiff.png)](http://travis-ci.org/liufengyun/hashdiff) +# HashDiff [![Build Status](https://secure.travis-ci.org/liufengyun/hashdiff.png)](http://travis-ci.org/liufengyun/hashdiff) [![Gem Version](https://badge.fury.io/rb/hashdiff.png)](http://badge.fury.io/rb/hashdiff) HashDiff is a ruby library to compute the smallest difference between two hashes. **Demo**: [HashDiff](http://hashdiff.herokuapp.com/) @@ -79,18 +79,20 @@ diff = HashDiff.diff(a, b) # diff two array is OK HashDiff.unpatch!(b, diff).should == a ### Options -You can specify the delimiter to be something else than the dot. For example: +There're two options available: `:delimiter` and `:similarity`. +You can specify `:delimiter` to be something else than the dot. For example: + a = {a:{x:2, y:3, z:4}, b:{x:3, z:45}} b = {a:{y:3}, b:{y:3, z:30}} diff = HashDiff.diff(a, b, :delimiter => '\t') diff.should == [['-', 'a\tx', 2], ['-', 'a\tz', 4], ['-', 'b\tx', 3], ['~', 'b\tz', 45, 30], ['+', 'b\ty', 3]] -In cases you have similar hash objects in array, you can pass suitable `:similarity` value instead of the default `0.8`. +In cases you have similar hash objects in array, you can pass a custom value for `:similarity` instead of the default `0.8`. ## Contributors - [@liufengyun](https://github.com/liufengyun) - [@m-o-e](https://github.com/m-o-e)