    # File lib/stella/core_ext.rb, line 472
      def flatten
        params = {}
        stack = []

        each do |k, v|
          if v.is_a?(Hash)
            stack << [k,v]
          elsif v.is_a?(Array)
            stack << [k,Hash.from_array(v)]
          else
            params[k] =  v
          end
        end

        stack.each do |parent, hash|
          hash.each do |k, v|
            if v.is_a?(Hash)
              stack << ["#{parent}[#{k}]", v]
            else
              params["#{parent}[#{k}]"] = v
            end
          end
        end

        params
      end