Question is, why Ruby returns Array on conf[:hash_key].first ?
The ideal method for me to get hash “hash_string” would be conf.first.first but this returns string “hash_string”.
This might be newbie question but I’m learning Ruby on my own
The ideal method for me to get hash “hash_string” would be conf.first.first but this returns string “hash_string”.
No. Since all these are Hashes you better use keys to do Hash lookups
instead of positional lookups (order is generally not guaranteed in a
Hash although Ruby’s Hash keeps insertion order):