Module: Kernel

Defined in:
lib/ataulfo/kernel_extension.rb

Instance Method Summary collapse

Instance Method Details

#with(object, &block) ⇒ Object



2
3
4
5
6
# File 'lib/ataulfo/kernel_extension.rb', line 2

def with(object, &block)
  other_self = eval "self", block.binding
  to_match   = Ataulfo::PatternMatching.new(object, other_self)
  to_match.instance_eval(&block)
end