Exception: Rails::PatternMatching::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Rails::PatternMatching::Error
- Defined in:
- lib/rails/pattern_matching.rb
Overview
This error is raised when the pattern matching behavior is already defined in a class or module that we’re trying to extend. We want to be careful not to silently override the behavior that’s already there.
Instance Method Summary collapse
-
#initialize(context) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(context) ⇒ Error
Returns a new instance of Error.
14 15 16 17 18 19 20 |
# File 'lib/rails/pattern_matching.rb', line 14 def initialize(context) super(<<~MSG) Pattern matching appears to already be defined in #{context}. In this case the rails-pattern_matching gem should not be used because it would override the pattern matching behavior given by #{context}. MSG end |