Answers for "ruby hash except nested"

0

ruby hash except nested

Hash[nested_hash.map {|k,v| [k,(v.respond_to?(:except)?v.except("nested_key2"):v)] }]

=> {"key1"=>"value1", "key2"=>{"nested_key1"=>"nestedvalue1"}}
Posted by: Guest on July-08-2021

Browse Popular Code Answers by Language