123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Core::Set Private

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
self, Enumerable
Inherits: Object
Defined in: rspec-core/lib/rspec/core/set.rb

Overview

We use this to replace ::Set so we can have the advantage of constant time key lookups for unique arrays but without the potential to pollute a developers environment with an extra piece of the stdlib. This helps to prevent false positive builds.

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#empty?Boolean (readonly)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/set.rb', line 19

def empty?
  @values.empty?
end

Instance Method Details

#<<(key)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/set.rb', line 23

def <<(key)
  @values[key] = true
  self
end

#clear

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/set.rb', line 48

def clear
  @values.clear
  self
end

#delete(key)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/set.rb', line 28

def delete(key)
  @values.delete(key)
end

#each(&block)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/set.rb', line 32

def each(&block)
  @values.keys.each(&block)
  self
end

#include?(key) ⇒ Boolean

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/set.rb', line 37

def include?(key)
  @values.key?(key)
end

#merge(values)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/set.rb', line 41

def merge(values)
  values.each do |key|
    @values[key] = true
  end
  self
end