Choose to Return Something Useful
Choose to Return SomethingΒ Useful
Β Today, I was working on a method to set a directory for an export. def set_export_dir(dir) @dir = dir FileUtils.mkdir_p(@dir) unless File.directory?(@dir) end My task was to document the method, and in doing so, I found myself trying to reason about the methodβs return value. It looks like there are two cases to consider β the directory already existed or we need to create it. If the directoryβ¦
View On WordPress











