Exception: Rails::PatternMatching::Error

Inherits:
StandardError
  • Object
show all
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

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