Class: Object
Defined Under Namespace
Modules: InstanceExecHelper
Instance Method Summary collapse
-
#instance_exec(*args, &block) ⇒ Object
!> method redefined; discarding old instance_exec.
Instance Method Details
#instance_exec(*args, &block) ⇒ Object
!> method redefined; discarding old instance_exec
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/capricorn/driver.rb', line 7 def instance_exec(*args, &block) # !> method redefined; discarding old instance_exec mname = "__instance_exec_#{Thread.current.object_id.abs}_#{object_id.abs}" InstanceExecHelper.module_eval{ define_method(mname, &block) } begin ret = __send__(mname, *args) ensure InstanceExecHelper.module_eval{ undef_method(mname) } rescue nil end ret end |