Class: Set
Instance Method Summary collapse
Instance Method Details
#delete_if ⇒ Object
2 3 4 5 6 |
# File 'lib/backports/1.9.2/stdlib/set.rb', line 2 def delete_if block_given? or return enum_for(__method__) to_a.each { |o| @hash.delete(o) if yield(o) } self end |
#keep_if ⇒ Object
8 9 10 11 12 |
# File 'lib/backports/1.9.2/stdlib/set.rb', line 8 def keep_if block_given? or return enum_for(__method__) to_a.each { |o| @hash.delete(o) unless yield(o) } self end |