Solved: How to iterize over JSON values?

Is it possible to iterize over JSON keys like with hash.each_key?

Would have to do json.as_h.each_key.

Unfortunately that does not work:


 45 | items["rates"].to_h.each_key do |k|
Error: undefined method 'to_h' for JSON::Any

It’s as_h not to_h.


1 Like

Yes, that works, reading is difficult :frowning:
Thanks @Blacksmoke16!