Here's something I expect to work:
for key in hash do value = hash[key] ...work with key and value... end
HOWEVER, in some cases with keys that are arrays or hashes,
value
will be nil
!
This problem can be avoided by iterating through the key/value pairs in tandem, like this,
for key,value in hash do ...work with key and value... endor this:
hash.each do |key,value| ...work with key and value... end
This problem can also be avoided by calling .compare_by_identity
on a Hash,
like this:
h = {}.compare_by_identitybut I'm resistant to doing that in the tests for
label.rb
.
None yet.
a8
instead of a9
,
and had a redundant paragraph, too.