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
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/backports-3.15.0/lib/backports/force/hash_select.rb
backports-3.15.0 lib/backports/force/hash_select.rb
backports-3.14.0 lib/backports/force/hash_select.rb
backports-3.13.0 lib/backports/force/hash_select.rb
backports-3.12.0 lib/backports/force/hash_select.rb
backports-3.11.4 lib/backports/force/hash_select.rb
backports-3.11.3 lib/backports/force/hash_select.rb
backports-3.11.2 lib/backports/force/hash_select.rb
backports-3.11.1 lib/backports/force/hash_select.rb
backports-3.11.0 lib/backports/force/hash_select.rb
backports-3.10.3 lib/backports/force/hash_select.rb
backports-3.10.2 lib/backports/force/hash_select.rb
backports-3.10.1 lib/backports/force/hash_select.rb
backports-3.10.0 lib/backports/force/hash_select.rb
backports-3.9.1 lib/backports/force/hash_select.rb
backports-3.9.0 lib/backports/force/hash_select.rb
backports-3.8.0 lib/backports/force/hash_select.rb
backports-3.7.0 lib/backports/force/hash_select.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/backports-3.6.8/lib/backports/force/hash_select.rb
backports-3.6.8 lib/backports/force/hash_select.rb