def flatten(level = 1)
      return List.from_enum(self) if level == 0
      array = []
      each { |k,v| array << k; array << v }
      array.flatten!(level-1) if level > 1
      return List.from_enum(array.freeze)
    end
def flatten(level = 1)
      return List.from_enum(self) if level == 0
      array = []
      each { |k,v| array << k; array << v }
      array.flatten!(level-1) if level > 1
      return List.from_enum(array.freeze)
    end
Return a new {List} which is a one-dimensional flattening of this `Map`.
 If `level` is 1, all the `[key, value]` pairs in the hash will be concatenated
 into one {List}. If `level` is greater than 1, keys or values which are
 themselves `Array`s or {List}s will be recursively flattened into the output
 {List}. The depth to which that flattening will be recursively applied is
 determined by `level`.

 As a special case, if `level` is 0, each `[key, value]` pair will be a
 separate element in the returned {List}.

 @example
   m = Erlang::Map["A" => 1, "B" => [2, 3, 4]]
   m.flatten
   # => Erlang::List["A", 1, "B", [2, 3, 4]]
   h.flatten(2)
   # => Erlang::List["A", 1, "B", 2, 3, 4]

 @param level [Integer] The number of times to recursively flatten the `[key, value]` pairs in this `Map`.
 @return [List]