Class: PatternMatching::CaseEqualityReversal

Inherits:
BasicObject
Defined in:
lib/pattern_matching/case_equality_reversal.rb

Overview

Used by #Match to invert the call to ‘===` by `when` clauses

Instance Method Summary collapse

Constructor Details

#initialize(*pattern) ⇒ CaseEqualityReversal

Returns a new instance of CaseEqualityReversal.



6
7
8
# File 'lib/pattern_matching/case_equality_reversal.rb', line 6

def initialize(*pattern)
  @pattern = pattern
end

Instance Method Details

#===(other) ⇒ Object



10
11
12
# File 'lib/pattern_matching/case_equality_reversal.rb', line 10

def ===(other)
  other.===(*@pattern)
end