Sha256: 7da1c9309a35b14c2cd557f0595e88cc834533f2b2363fb6fed510f38faabd15

Contents?: true

Size: 557 Bytes

Versions: 47

Compression:

Stored size: 557 Bytes

Contents

class Object #:nodoc:
  module InstanceExecHelper #:nodoc:
  end
  include InstanceExecHelper
  def instance_eval_with_params(*args, &block)
    begin
      old_critical, Thread.critical = Thread.critical, true
      n = 0
      n += 1 while respond_to?(mname="__instance_exec#{n}")
      InstanceExecHelper.module_eval{ define_method(mname, &block) }
    ensure
      Thread.critical = old_critical
    end
    begin
      ret = send(mname, *args)
    ensure
      InstanceExecHelper.module_eval{ remove_method(mname) } rescue nil
    end
    ret
  end
end

Version data entries

47 entries across 47 versions & 10 rubygems

Version Path
hashrocket-validatable-1.7.2 lib/object_extension.rb
hashrocket-validatable-1.7.4 lib/object_extension.rb
jnunemaker-validatable-1.7.0 lib/object_extension.rb
jnunemaker-validatable-1.7.1 lib/object_extension.rb
jnunemaker-validatable-1.7.2 lib/object_extension.rb
ramsingla-validatable-1.7.2 lib/object_extension.rb
ramsingla-validatable-1.7.3 lib/object_extension.rb
vizjerai-validatable-1.8.0 lib/object_extension.rb
vizjerai-validatable-1.9.0 lib/object_extension.rb
erotte-validatable-1.8.5 lib/validatable/object_extension.rb
mongomatic-0.1.31 lib/mongomatic/validatable/object_extension.rb
mongomatic-0.1.3 lib/mongomatic/validatable/object_extension.rb
mongomatic-0.1.2 lib/mongomatic/validatable/object_extension.rb
mongomatic-0.1.1 lib/mongomatic/validatable/object_extension.rb
mongomatic-0.1.0 lib/mongomatic/validatable/object_extension.rb
mongomatic-0.0.9 lib/mongomatic/validatable/object_extension.rb
mongomatic-0.0.8 lib/mongomatic/validatable/object_extension.rb
mongomatic-0.0.7 lib/mongomatic/validatable/object_extension.rb
mongomatic-0.0.6 lib/mongomatic/validatable/object_extension.rb
mongomatic-0.0.5 lib/mongomatic/validatable/object_extension.rb