Sha256: 5155c7e2d6f14d2a28ac72cb83844ac59c79fc74ad1244b527c70e705b97aeb4

Contents?: true

Size: 254 Bytes

Versions: 23

Compression:

Stored size: 254 Bytes

Contents

class Hash
  if {}.select{} == []
    def select_with_hash_return
      return to_enum(:select) unless block_given?
      Hash[select_without_hash_return{|k, v| yield [k, v]}]
    end
    Backports.alias_method_chain self, :select, :hash_return
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
backports-2.5.1 lib/backports/force/hash_select.rb
backports-2.5.0 lib/backports/force/hash_select.rb
backports-2.4.0 lib/backports/force/hash_select.rb