Module: PatternMatching::Methods

Defined in:
lib/pattern_matching/methods.rb

Instance Method Summary collapse

Instance Method Details

#Match(*pattern) ⇒ Object

Wraps a matchable ‘pattern’ in an object that inverts ‘===` (case-equality method).



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

def Match(*pattern)
  ::PatternMatching::CaseEqualityReversal.new(*pattern)
end

#Pattern(*pattern) ⇒ Object

Wraps an argument list as a pattern for use in a call to #Match



12
13
14
# File 'lib/pattern_matching/methods.rb', line 12

def Pattern(*pattern)
  ::PatternMatching::PatternMatch.new(*pattern)
end