def assert_param_presence( param, name = "input value" )
      case param
      when String, Symbol, Numeric
        param = param.to_s.strip
        raise ArgumentError, "#{name} cannot be blank: #{param.inspect}" if param =~ /\A\s*\z/
        param

      when Array
        param.flatten.map { |item| assert_param_presence(item, name) }.join(",")

      when nil
        raise ArgumentError, "#{name} cannot be nil"

      else
        raise ArgumentError, "#{name} is invalid: #{param.inspect}"
      end
    end
def assert_param_presence( param, name = "input value" )
      case param
      when String, Symbol, Numeric
        param = param.to_s.strip
        raise ArgumentError, "#{name} cannot be blank: #{param.inspect}" if param =~ /\A\s*\z/
        param

      when Array
        param.flatten.map { |item| assert_param_presence(item, name) }.join(",")

      when nil
        raise ArgumentError, "#{name} cannot be nil"

      else
        raise ArgumentError, "#{name} is invalid: #{param.inspect}"
      end
    end
Internal: Ensure that the parameter has a valid value. Strings, Symbols,
 Numerics, and Arrays of those things are valid. Things like `nil`
 and empty strings are right out. This method also performs a little
 formating on the parameter:

 * leading and trailing whitespace is removed
 * arrays are flattend
 * and then joined into a String
 * numerics are converted to their string equivalents

 param - The param Object to validate
 name  - Optional param name as a String (used in exception messages)

 Returns the validated param as a String.
 Raises an ArgumentError if the param is not valid.