README.md in hash_dot-2.1.0 vs README.md in hash_dot-2.2.0

- old
+ new

@@ -1,5 +1,7 @@ +[![Build Status](https://travis-ci.org/adsteel/hash_dot.svg?branch=master)](https://travis-ci.org/adsteel/hash_dot) + # HashDot HashDot allows you to get and set your Ruby hash properties with a dot syntax. ```ruby @@ -23,9 +25,23 @@ ```ruby Hash.use_dot_syntax = true {name: 'Pat'}.name #=> 'Pat' +``` + +By default HashDot raises a `NoMethodError` when accessing a non-existent key with the dot syntax. The value of `Hash#default` can be used instead, either globally or per-instance, via: + +```ruby +# globally +Hash.use_dot_syntax = true +Hash.hash_dot_use_default = true +{}.a #=> 'default' + +# per instance +h = Hash.new('default').to_dot(use_default: true) +h.a #=> 'default' +{}.to_dot.a #=> NoMethodError ``` ## Installation