Sha256: fe62ab79019030f0b9541bcef430835dc41e9941dc23f71113305c2a79f16684

Contents?: true

Size: 340 Bytes

Versions: 23

Compression:

Stored size: 340 Bytes

Contents

class Set
  def delete_if
    block_given? or return enum_for(__method__)
    to_a.each { |o| @hash.delete(o) if yield(o) }
    self
  end unless method_defined? :delete_if

  def keep_if
    block_given? or return enum_for(__method__)
    to_a.each { |o| @hash.delete(o) unless yield(o) }
    self
  end unless method_defined? :keep_if
end

Version data entries

23 entries across 23 versions & 2 rubygems

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