Method: Set#clear

Defined in:
lib/set.rb

#clearObject

Removes all elements and returns self.

set = Set[1, 'c', :s]             #=> #<Set: {1, "c", :s}>
set.clear                         #=> #<Set: {}>
set                               #=> #<Set: {}>

316
317
318
319
# File 'lib/set.rb', line 316

def clear
  @hash.clear
  self
end