Deeply extract all used symbols from a hash of nested symbols in an array
Some notes:


The flattening should be performed where the non-desired nesting is being introduced, not later. Use flat_map instead of map:
Why e for the value name instead of v?


I'd write:

def all_keys(hash)
  hash.keys + hash.values.flat_map { |v| v.is_a?(Hash) ? all_keys(v) : [v] }
end


Another way to do it, slightly shorter, is to iterate directly the pairs. Pick the one which is more declarative to you:

def all_keys(hash)
  hash.flat_map { |k, v| [k] + (v.is_a?(Hash) ? all_keys(v) : [v]) }
end