module DSLKit::InstanceExec
def instance_exec(*args, &block)
executes _block_ in the context of this object while parsing *args into
This is a pure ruby implementation of Ruby 1.9's instance_exec method. It
def instance_exec(*args, &block) instance = self id = instance_exec_fetch_symbol InstanceExec.module_eval do begin define_method id, block instance.__send__ id, *args ensure remove_method id if method_defined?(id) end end ensure InstanceExec.pool << id end