public Method

Set.reject!() { |o| ... }

Equivalent to Set#delete_if, but returns nil if no changes were made.

Source Code

# File set.rb, line 245
def reject!
  n = size
  delete_if { |o| yield(o) }
  size == n ? nil : self
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.