Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

YARD convention for "any" object as a parameter

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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

>Solution :

Since 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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading