You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We might want to get the set of unique leaf keys back by default
Suggested solution
def leaf_keys
each_with_object([]) do |(key, value), result|
if value.is_a?(Hash) && !value.empty?
result.concat(value.leaf_keys)
else
result << key
end
end.uniq
end
The text was updated successfully, but these errors were encountered:
Example Usage:
We might want to get the set of unique leaf keys back by default
Suggested solution
The text was updated successfully, but these errors were encountered: