Exception: FeatureEnvy::FinalClass::Error

Inherits:
Error
  • Object
show all
Defined in:
lib/feature_envy/final_class.rb

Overview

An error representing a final class invariant violation.

Instance Method Summary collapse

Constructor Details

#initialize(final_class:, subclasses:) ⇒ Error

Returns a new instance of Error.



48
49
50
51
52
53
54
# File 'lib/feature_envy/final_class.rb', line 48

def initialize final_class:, subclasses:
  super(<<~ERROR)
    Class #{FeatureEnvy::Internal.class_name final_class} is final but the following subclasses were defined:

    #{subclasses.map { "- #{FeatureEnvy::Internal.class_name _1}" }.join("\n")}
  ERROR
end