+ 7
Ruby equivalent .items() method?
Is there a Ruby equivalent of the Python dictionary ".items()" method that returns a list of (key, value) pairs of a hash?
2 Antworten
+ 2
You can use the to_a method of hash
+ 1
to_a method will do the trick
Is there a Ruby equivalent of the Python dictionary ".items()" method that returns a list of (key, value) pairs of a hash?