Exception: RubyPi::AbstractMethodError
- Defined in:
- lib/ruby_pi/errors.rb
Overview
Raised when a subclass does not implement a required abstract method from a base class.
Issue #14: Renamed from NotImplementedError to AbstractMethodError to avoid shadowing Ruby’s stdlib NotImplementedError < ScriptError. The stdlib class is raised by Kernel#fork on platforms that don’t support it, and shadowing it can cause confusing rescue behavior.
Instance Method Summary collapse
-
#initialize(method_name = nil) ⇒ AbstractMethodError
constructor
A new instance of AbstractMethodError.
Constructor Details
#initialize(method_name = nil) ⇒ AbstractMethodError
Returns a new instance of AbstractMethodError.
98 99 100 |
# File 'lib/ruby_pi/errors.rb', line 98 def initialize(method_name = nil) super(method_name ? "Subclass must implement ##{method_name}" : "Subclass must implement this method") end |