Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to YARD document a method that returns nothing

I have a method like this

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

which I'm trying to document with YARD. However this is a method which is 100% side effect (I know, I know, side effects, urgh!). But for users of this method there is effectively no returned object of any type, however YARD generates a signature like this:

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

Is there any way to tell yard that the import method returns nothing?

I can tell it to return nil, but that's not really the same thing

like image 495
Jamie Cook Avatar asked Sep 07 '14 22:09

Jamie Cook


1 Answers

All methods return something, the void key word might be what you are looking for.

# @return [void]
def method_returning_unknown_object
end

void return rendering

like image 108
G. Allen Morris III Avatar answered Sep 21 '22 01:09

G. Allen Morris III