How to YARD document a method that returns nothing

I have such a method

def self.import(file_name, opts = {}) 

which I am trying to document using YARD. However, this is a method that is 100% side effect (I know, I know, side effects, urgh!). But for users of this method, there is actually no returned object of any type, however YARD generates such a signature:

 + (Object) import(file_name, opts = {}) 

Is there a way to tell the shortcut that the import method returns nothing?

I can say that it returns zero, but this is not quite the same

+6
source share
1 answer

All methods return something, the void keyword may be what you are looking for.

 # @return [void] def method_returning_unknown_object end 

void return rendering

+7
source

Source: https://habr.com/ru/post/974949/


All Articles