diff options
author | Michael Herold <michael.j.herold@gmail.com> | 2017-02-01 08:03:45 -0600 |
---|---|---|
committer | Michael Herold <michael.j.herold@gmail.com> | 2017-02-04 14:38:00 -0600 |
commit | b2f94a486650587573fea808cf0b1dbb06bc57e5 (patch) | |
tree | 5c1c075c9be1523b62c94a3a107b9051bbcd400a /UPGRADING.md | |
parent | 24caf3564e3073c68227590e72bf43e0a604ac68 (diff) | |
download | hashie-b2f94a486650587573fea808cf0b1dbb06bc57e5.tar.gz |
Allow Mash subclasses to disable warnings
Since we are transitively used as a dependency in many projects, we
should have given the ability to toggle this behavior off. The logging
feature is more of a "help people get started with Mash" feature. If
you're using Hashie in a library, it's likely that you already know the
tradeoffs of attempting to override methods on the object.
To use this feature, you only have to subclass Mash and then call the
class method:
```ruby
class KeyStore < Hashie::Mash
disable_warnings
end
```
Diffstat (limited to 'UPGRADING.md')
-rw-r--r-- | UPGRADING.md | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/UPGRADING.md b/UPGRADING.md index a6334a1..5a9f05a 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,6 +1,19 @@ Upgrading Hashie ================ +### Upgrading to 3.5.2 + +#### Disable logging in Mash subclasses + +If you subclass `Hashie::Mash`, you can now disable the logging we do about +overriding existing methods with keys. This looks like: + +```ruby +class MyMash < Hashie::Mash + disable_warnings +end +``` + ### Upgrading to 3.4.7 #### Procs as default values for Dash @@ -11,7 +24,7 @@ class MyHash < Hashie::Dash end ``` -In versions < 3.4.7 `Time.now` will be evaluated when `time` property is accessed directly first time. +In versions < 3.4.7 `Time.now` will be evaluated when `time` property is accessed directly first time. In version >= 3.4.7 `Time.now` is evaluated in time of object initialization. ### Upgrading to 3.4.4 |