Sha256: cdca2936fbdc5dde707e3c90da6701ba267b796a4cf8fb3d768c50d3cd552506

Contents?: true

Size: 347 Bytes

Versions: 27

Compression:

Stored size: 347 Bytes

Contents

# frozen_string_literal: true

# only needed when ruby < 2.4 and not using active support

unless {}.respond_to? :compact
  # https://github.com/rails/rails/blob/fc5dd0b85189811062c85520fd70de8389b55aeb/activesupport/lib/active_support/core_ext/hash/compact.rb
  class Hash
    def compact
      select { |_, value| !value.nil? }
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
racecar-2.11.0 lib/ensure_hash_compact.rb
racecar-2.11.0.beta4 lib/ensure_hash_compact.rb
racecar-2.11.0.beta3 lib/ensure_hash_compact.rb
racecar-2.11.0.beta2 lib/ensure_hash_compact.rb
racecar-2.11.0.beta1 lib/ensure_hash_compact.rb
racecar-2.10.0 lib/ensure_hash_compact.rb
racecar-2.10.0.beta2 lib/ensure_hash_compact.rb
racecar-2.10.0.beta1 lib/ensure_hash_compact.rb
racecar-2.9.0 lib/ensure_hash_compact.rb
racecar-2.9.0.beta1 lib/ensure_hash_compact.rb
racecar-2.8.2 lib/ensure_hash_compact.rb
racecar-2.8.2.beta lib/ensure_hash_compact.rb
racecar-2.8.1 lib/ensure_hash_compact.rb
racecar-2.8.0.rc.1 lib/ensure_hash_compact.rb
racecar-2.8.0.beta.2 lib/ensure_hash_compact.rb
racecar-2.8.0.beta.1 lib/ensure_hash_compact.rb
racecar-2.7.0 lib/ensure_hash_compact.rb
racecar-2.7.0.beta1 lib/ensure_hash_compact.rb
racecar-2.6.0 lib/ensure_hash_compact.rb
racecar-2.5.0 lib/ensure_hash_compact.rb