Class: Set

Inherits:
Object
  • Object
show all
Defined in:
lib/sorted_containers/core_extensions.rb

Overview

Set class is being extended to include a method for converting a Set to a SortedSet.

Instance Method Summary collapse

Instance Method Details

#to_sorted_set(load_factor: SortedContainers::SortedArray::DEFAULT_LOAD_FACTOR) ⇒ SortedContainers::SortedSet

Converts the set to a SortedSet.

Parameters:

  • load_factor (Integer) (defaults to: SortedContainers::SortedArray::DEFAULT_LOAD_FACTOR)

    The load factor for the SortedSet.

Returns:



53
54
55
# File 'lib/sorted_containers/core_extensions.rb', line 53

def to_sorted_set(load_factor: SortedContainers::SortedArray::DEFAULT_LOAD_FACTOR)
  SortedContainers::SortedSet.new(self, load_factor: load_factor)
end