In particular, `.new`, `#update`, `#merge`, `#replace` all accept objects which respond to `#to_hash`, even if those objects are not Hashes directly.
According to our guideline, we leave 1 space between `#` and `=>`, so we want `# =>` instead of `#=>`. Thanks to @fxn for the suggestion. [ci skip]
Hash#select! returns nil if the hash didn't change and thus behaves differently from select, so it's return value can't be used as result for the latter.
Change to destructive `deep_symbolize_keys` to avoid a new hash creation.
…lect HashWithIndifferentAccess#select working as intended
Before this commit, #reject returned a HashWithIndifferentAccess, whereas #select returned a Hash. Now #select also returns a HashWithIndifferentAccess.
…s to do so. This helps to avoid extra hash object creation, by symbolizing inplace
fix HashWithIndifferentAccess#to_hash behaviour
"There're" => There are for better readability
When a block is passed into the method, it will be invoked for each duplicated key, with the key in question and the two values as arguments. The value for the duplicated key in the receiver will be set to the return value of the block. This behaviour matches Ruby's long-standing implementation of Hash#update and is intended to provide a more consistent interface. HashWithIndifferentAccess#merge is also affected by the change, as it uses #update internally.
…bang) for nested hashes
Removed some useless docstrings and no-doc'ed some.
…ccess to return self.
This commit makes Hash subclasses convert to HWIA by default for nested objects of subclasses of Hash, but allows certain subclasses to prevent nested conversion by introducing Hash#nested_under_indifferent_access that subclasses can overwrite. ActiveSupport::OrderedHash is one such subclass that overwrites +nested_under_indifferent_access+, since implicitly converting it to HWIA would remove the ordering of keys and values in Ruby 1.8. This change is necessary because commit ce9456e broke nested indifferent access conversion for all subclasses of Hash.