I have a function that takes a variable number of arguments, for example:
def myfun(*args) # ... end
All arguments are of the same type ( Symbol), so right now I'm documenting the function as if there was only one argument, saying that it can take more than one, for example:
Symbol
# this function doesn’t do anything # @param [Symbol]: this argument does something, you can add more symbols # if you want def myfun(*args) # ... end
Is there a built-in way to handle this case?
The following makes sense because it argsis Arrayinside the method, although none of the parameters are Arrayas such:
args
Array
# this function doesn’t do anything # # @param [Array<Symbol>] args these arguments do something # @return [nil] def myfun(*args) # ... end
, * . - args Array, *args .
*
*args
, , .rb Yard (, . Verifier) - .
Source: https://habr.com/ru/post/1538312/More articles:Using DownloadManager to download to a new folder on the phone - javaОбновлено до MS Identity Core 2.0 и EF6.1 и логин завершается с ошибкой: недопустимое имя столбца 'Email' - asp.netHow to write this in the most efficient way - pythonVectorization / optimization of a loop with unequal data access for wide registers (in particular, Xeon Phi) - c ++Convert.ToDouble ("1.3") returns 13 - castingAdd multiple tags to ggplot2 boxplot - rдоступ к неограниченной памяти - assemblyC # convert string to double in locale - c #Half-step transfer of the MATLAB axis - matlabJOOQ pojos с отношениями "один ко многим" и "многие ко многим" - javaAll Articles