2 ms·
The recommended and near-universally used Ruby hash keys are immutable. Symbols are used most frequently, but even if you pass a string as a hash key it gets au
by carbon8 17y ago
The recommended and near-universally used Ruby hash keys are immutable. Symbols are used most frequently, but even if you pass a string as a hash key it gets automatically copied and frozen. freeze is also a method on Object and can be used anywhere to make an object immutable.