module PatternMatching::MethodsWithBindingHelper

Public Instance Methods

Match(*pattern) click to toggle source

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

# File lib/pattern_matching/methods_with_binding_helper.rb, line 6
def Match(*pattern)
  result = ::PatternMatching::CaseEqualityReversal.new(*pattern)
  (self.class)::B._clear_bindings!(caller_locations(1,1)[0].label) unless result
  result
end
Pattern(*pattern) click to toggle source

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

# File lib/pattern_matching/methods_with_binding_helper.rb, line 14
def Pattern(*pattern)
  (self.class)::B._clear_bindings!(caller_locations(1,1)[0].label)
  ::PatternMatching::PatternMatch.new(*pattern)
end