Sha256: da51f1e4a63502248771c8e3967c4717705934baf8cd814f62317eff7fb19142

Contents?: true

Size: 456 Bytes

Versions: 21

Compression:

Stored size: 456 Bytes

Contents

# Temp until https://github.com/opal/opal/pull/596
require 'set'

class Set
  def delete(o)
    if include?(o)
      @hash.delete(o)
      true
    else
      nil
    end
  end

  def delete_if
    block_given? or return enum_for(__method__)
    # @hash.delete_if should be faster, but using it breaks the order
    # of enumeration in subclasses.
    select { |o| yield o }.each { |o| @hash.delete(o) }
    self
  end

  def to_a
    @hash.keys
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
volt-0.9.5 lib/volt/utils/set_patch.rb
volt-0.9.5.pre12 lib/volt/utils/set_patch.rb
volt-0.9.5.pre11 lib/volt/utils/set_patch.rb
volt-0.9.5.pre9 lib/volt/utils/set_patch.rb
volt-0.9.5.pre8 lib/volt/utils/set_patch.rb
volt-0.9.5.pre7 lib/volt/utils/set_patch.rb
volt-0.9.5.pre6 lib/volt/utils/set_patch.rb
volt-0.9.5.pre5 lib/volt/utils/set_patch.rb
volt-0.9.5.pre4 lib/volt/utils/set_patch.rb
volt-0.9.5.pre3 lib/volt/utils/set_patch.rb
volt-0.9.5.pre2 lib/volt/utils/set_patch.rb
volt-0.9.5.pre1 lib/volt/utils/set_patch.rb
volt-0.9.4 lib/volt/utils/set_patch.rb
volt-0.9.4.pre5 lib/volt/utils/set_patch.rb
volt-0.9.4.pre3 lib/volt/utils/set_patch.rb
volt-0.9.4.pre2 lib/volt/utils/set_patch.rb
volt-0.9.4.pre1 lib/volt/utils/set_patch.rb
volt-0.9.3 lib/volt/utils/set_patch.rb
volt-0.9.3.pre6 lib/volt/utils/set_patch.rb
volt-0.9.3.pre5 lib/volt/utils/set_patch.rb