YARD convention for "any" object as a parameter

436 views Asked by At

How to document a YARD parameter that could be of any type possible?

Is there a convention for it?

This is similar to Any type in TypeScript

# @param [?] var1
def create_foo(var1)
  # var1 could be anything
end
1

There are 1 answers

6
Yakov On BEST ANSWER

Since almost every object in Ruby inherits behavior from the class Object, # @param [Object] var1 seems like an appropriate choice.

A few examples from rubygems/rubygems and lostisland/faraday