diff options
author | Bobby McDonald <bobbymcwho@gmail.com> | 2019-10-17 22:21:49 -0400 |
---|---|---|
committer | Bobby McDonald <bobbymcwho@gmail.com> | 2019-10-17 22:21:49 -0400 |
commit | a21bb32235a37d5b0c00ced22e7fbfea1734918b (patch) | |
tree | d6782b3630b4b70ef9e66e790b022bc6d7351250 /lib/hashie | |
parent | 20e5467188bb4b6ab4166a72c07ec2bc0b883fa0 (diff) | |
download | hashie-a21bb32235a37d5b0c00ced22e7fbfea1734918b.tar.gz |
remove tap and use block
Diffstat (limited to 'lib/hashie')
-rw-r--r-- | lib/hashie/mash.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/hashie/mash.rb b/lib/hashie/mash.rb index 77a852f..27e6409 100644 --- a/lib/hashie/mash.rb +++ b/lib/hashie/mash.rb @@ -108,11 +108,10 @@ module Hashie # Hashie::Mash.quiet(:zip).new(hash) only zip warning # is disabled. def self.quiet(*method_keys) - (@memoized_classes ||= {})[method_keys] || - Class.new(self).tap do |k| - k.send(:disable_warnings, *method_keys) - @memoized_classes[method_keys] = k - end + @memoized_classes ||= {} + @memoized_classes[method_keys] ||= Class.new(self) do + disable_warnings(*method_keys) + end end class << self; alias [] new; end |