Can I check the a hash contain another hash in deep check?

h = {‘Member’=>{‘number’=>{‘name’=>‘Name’}}}

Can I check from the key which the value is also hashes?
example:

has_hash_value(h[‘Member’]) = true/ false

some kind like this… Can I?

Siratinee S. wrote in post #994555:

h = {‘Member’=>{‘number’=>{‘name’=>‘Name’}}}

Can I check from the key which the value is also hashes?
example:

has_hash_value(h[‘Member’]) = true/ false

some kind like this… Can I?

h = {‘Member’=>{‘number’=>{‘name’=>‘Name’}}}

if h[‘Member’].instance_of?(Hash)
puts ‘yes’
end

–output:–
yes

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs