Sha256: d8805041b3b6a38d245d74955697db9dac07435a21a3d94cf5b2ef0aa49ff9f2

Contents?: true

Size: 318 Bytes

Versions: 43

Compression:

Stored size: 318 Bytes

Contents

class Hash
  def keep_if
    return to_enum(:keep_if) unless block_given?
    delete_if{|key, value| ! yield key, value}
  end unless method_defined? :keep_if

  def select!(&block)
    return to_enum(:select!) unless block_given?
    reject!{|key, value| ! yield key, value}
  end unless method_defined? :select!
end

Version data entries

43 entries across 43 versions & 2 rubygems

Version Path
backports-3.0.3 lib/backports/1.9.2/hash.rb
backports-3.0.2 lib/backports/1.9.2/hash.rb
backports-3.0.1 lib/backports/1.9.2/hash.rb
backports-3.0.0 lib/backports/1.9.2/hash.rb
backports-2.8.2 lib/backports/1.9.2/hash.rb
backports-2.8.1 lib/backports/1.9.2/hash.rb
backports-2.8.0 lib/backports/1.9.2/hash.rb
backports-2.7.1 lib/backports/1.9.2/hash.rb
backports-2.7.0 lib/backports/1.9.2/hash.rb
backports-2.6.7 lib/backports/1.9.2/hash.rb
backports-2.6.6 lib/backports/1.9.2/hash.rb
backports-2.6.5 lib/backports/1.9.2/hash.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/backports-2.6.4/lib/backports/1.9.2/hash.rb
backports-2.6.4 lib/backports/1.9.2/hash.rb
backports-2.6.3 lib/backports/1.9.2/hash.rb
backports-2.6.2 lib/backports/1.9.2/hash.rb
backports-2.6.1 lib/backports/1.9.2/hash.rb
backports-2.6.0 lib/backports/1.9.2/hash.rb
backports-2.5.3 lib/backports/1.9.2/hash.rb
backports-2.5.2 lib/backports/1.9.2/hash.rb