🌘 Ruby 中的抽象方法和 NotImplementedError
➤ 在 Ruby 中使用 NotImplementedError 的正確方法
https://nithinbekal.com/posts/abstract-methods-notimplementederror-ruby/
Ruby 中 NotImplementedError 異常通常用作抽象類別中應由子類實作的方法的佔位符,但這並非該異常類別的原始用途。文章提及 NotImplementedError 的常見(誤)用法,以及避免使用該異常的替代方法。
+ 讓人對 Ruby 中 NotImplementedError 的正確用法有更深入的瞭解。
+ 對於想要提高 Ruby 代碼品質和避免常見錯誤的人來說,這篇文章提供了實用的建議。
#Ruby #抽象方法 #NotImplementedError
Abstract methods and NotImplementedError in Ruby

Nithin Bekal's blog about programming - Ruby, Rails, Vim, Elixir.

Please Stop Abusing NotImplementedError

Raising NotImplementedError simply to signal that a subclass didn't abide by the contract of its superclass is an abuse of the error.

Chris Stump Online