Class: Object

Inherits:
BasicObject
Defined in:
lib/pattern-match/experimental.rb

Instance Method Summary collapse

Instance Method Details

#assert_pattern(pattern) ⇒ Object



189
190
191
192
193
# File 'lib/pattern-match/experimental.rb', line 189

def assert_pattern(pattern)
  match(self) do
    Kernel.eval("with(#{pattern}) { self }", Kernel.binding)
  end
end