Ruby - raise Exception.new or raise Exception - they're both the same | Arkency Blog
The way I’m raising the exception here is that I raise it without calling .new. This may look as if I’m raising a class, not an object.Some people asked me if this actually works and if it’s the same.We already know the short answer, so let’s dig into why it’s the same. Is there some kind of magic involved?One place to go is to check the raise (Kernel) - APIdock documentation.
Ruby - raise Exception.new or raise Exception - they're both the same | Arkency Blog #ruby #rails #rubyonrails #bosnia #programming #tutorials #rubydeveloper #railsdeveloper