It occurs to me that you can override https://Class.new to do this and make a much cleaner API.

Any reason not to do this regularly? Feels weird to return `nil` from a constructor, but it would be darn handy a lot of times.

https://gist.github.com/davetron5000/1a6b394f4295f1b70062baab013d297f#file-new-rb
Post image

Comments