Sha256: 24c52cdc4433b3975498b4b82ef5286e6e7906cda2f152236e25d42a4f69c7b7

Contents?: true

Size: 460 Bytes

Versions: 1

Compression:

Stored size: 460 Bytes

Contents

module Polyfill
  module V2_4
    module Hash
      module Instance
        module Compact
          module Method
            def compact
              reject { |_, v| v.nil? }
            end
          end

          if RUBY_VERSION < '2.4.0'
            refine ::Hash do
              include Method
            end

            def self.included(base)
              base.include Method
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polyfill-0.3.0 lib/polyfill/v2_4/hash/instance/compact.rb