Sha256: 5e999385e7260cb136c6d83df371dc734940f83ee0df8624c1ee1a92e3a69bef

Contents?: true

Size: 316 Bytes

Versions: 10

Compression:

Stored size: 316 Bytes

Contents

# 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

10 entries across 10 versions & 1 rubygems

Version Path
racecar-2.0.0 lib/ensure_hash_compact.rb
racecar-2.0.0.beta6 lib/ensure_hash_compact.rb
racecar-2.0.0.beta5 lib/ensure_hash_compact.rb
racecar-2.0.0.beta4 lib/ensure_hash_compact.rb
racecar-2.0.0.beta3 lib/ensure_hash_compact.rb
racecar-2.0.0.beta2 lib/ensure_hash_compact.rb
racecar-2.0.0.beta1 lib/ensure_hash_compact.rb
racecar-2.0.0.alpha3 lib/ensure_hash_compact.rb
racecar-2.0.0.alpha2 lib/ensure_hash_compact.rb
racecar-2.0.0.alpha1 lib/ensure_hash_compact.rb