Class: GeneticAlgorithms::NaturalHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/genetic_algorithms/natural_hash.rb

Instance Method Summary collapse

Instance Method Details

#mapObject



3
4
5
6
# File 'lib/genetic_algorithms/natural_hash.rb', line 3

def map
  result = super()
  hash_structure?(result) ? NaturalHash[ result ] : result
end

#sort_byObject



8
9
10
# File 'lib/genetic_algorithms/natural_hash.rb', line 8

def sort_by
  NaturalHash[ super ]
end