lib/refinements/hashes.rb in refinements-9.0.2 vs lib/refinements/hashes.rb in refinements-9.1.0

- old
+ new

@@ -1,7 +1,9 @@ # frozen_string_literal: true +require "refinements/shared/enumerables/many" + module Refinements # Provides additional enhancements to the Hash primitive. module Hashes refine Hash.singleton_class do def infinite @@ -10,9 +12,11 @@ def with_default(value) = new { |new_hash, missing_key| new_hash[missing_key] = value } end refine Hash do + import_methods Shared::Enumerables::Many + def compress = dup.compress! def compress! return self if empty?