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.25.0 lib/backports/force/hash_select.rb
backports-3.24.1 lib/backports/force/hash_select.rb
backports-3.24.0 lib/backports/force/hash_select.rb
backports-3.23.0 lib/backports/force/hash_select.rb
backports-3.22.1 lib/backports/force/hash_select.rb
backports-3.22.0 lib/backports/force/hash_select.rb
backports-3.21.0 lib/backports/force/hash_select.rb
backports-3.20.2 lib/backports/force/hash_select.rb
backports-3.20.1 lib/backports/force/hash_select.rb
backports-3.20.0 lib/backports/force/hash_select.rb
backports-3.19.0 lib/backports/force/hash_select.rb
backports-3.18.2 lib/backports/force/hash_select.rb
backports-3.18.1 lib/backports/force/hash_select.rb
backports-3.18.0 lib/backports/force/hash_select.rb
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/backports-3.12.0/lib/backports/force/hash_select.rb
backports-3.17.2 lib/backports/force/hash_select.rb
backports-3.17.1 lib/backports/force/hash_select.rb
backports-3.17.0 lib/backports/force/hash_select.rb
backports-3.16.1 lib/backports/force/hash_select.rb
backports-3.16.0 lib/backports/force/hash_select.rb