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-3.0.3 lib/backports/force/hash_select.rb
backports-3.0.2 lib/backports/force/hash_select.rb
backports-3.0.1 lib/backports/force/hash_select.rb
backports-3.0.0 lib/backports/force/hash_select.rb
backports-2.8.2 lib/backports/force/hash_select.rb
backports-2.8.1 lib/backports/force/hash_select.rb
backports-2.8.0 lib/backports/force/hash_select.rb
backports-2.7.1 lib/backports/force/hash_select.rb
backports-2.7.0 lib/backports/force/hash_select.rb
backports-2.6.7 lib/backports/force/hash_select.rb
backports-2.6.6 lib/backports/force/hash_select.rb
backports-2.6.5 lib/backports/force/hash_select.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/backports-2.6.4/lib/backports/force/hash_select.rb
backports-2.6.4 lib/backports/force/hash_select.rb
backports-2.6.3 lib/backports/force/hash_select.rb
backports-2.6.2 lib/backports/force/hash_select.rb
backports-2.6.1 lib/backports/force/hash_select.rb
backports-2.6.0 lib/backports/force/hash_select.rb
backports-2.5.3 lib/backports/force/hash_select.rb
backports-2.5.2 lib/backports/force/hash_select.rb