Sha256: 951fca430b818b3f123694206cd7209ed304a4c7b7ed9e34c03a4b3fab868b85

Contents?: true

Size: 300 Bytes

Versions: 47

Compression:

Stored size: 300 Bytes

Contents

require 'backports/tools/alias_method_chain'
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

47 entries across 47 versions & 4 rubygems

Version Path
backports-3.6.7 lib/backports/force/hash_select.rb
backports-3.6.6 lib/backports/force/hash_select.rb
backports-3.6.5 lib/backports/force/hash_select.rb
backports-3.6.4 lib/backports/force/hash_select.rb
backports-3.6.3 lib/backports/force/hash_select.rb
backports-3.6.2 lib/backports/force/hash_select.rb
backports-3.6.1 lib/backports/force/hash_select.rb