Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/sorted_containers/core_extensions.rb
Overview
Hash class is being extended to include a method for converting a Hash to a SortedHash.
Instance Method Summary collapse
-
#to_sorted_h(load_factor: SortedContainers::SortedArray::DEFAULT_LOAD_FACTOR) ⇒ SortedContainers::SortedHash
Converts the hash to a SortedHash.
Instance Method Details
#to_sorted_h(load_factor: SortedContainers::SortedArray::DEFAULT_LOAD_FACTOR) ⇒ SortedContainers::SortedHash
Converts the hash to a SortedHash.
39 40 41 42 43 |
# File 'lib/sorted_containers/core_extensions.rb', line 39 def to_sorted_h(load_factor: SortedContainers::SortedArray::DEFAULT_LOAD_FACTOR) hash = SortedContainers::SortedHash.new(load_factor: load_factor) hash.merge!(self) hash end |