Sha256: 1ed2c27d1997ed72b8f7043cb9bd3247e971f5d94751eab11f9e5cb6c9f7357e

Contents?: true

Size: 649 Bytes

Versions: 19

Compression:

Stored size: 649 Bytes

Contents

class Object
  extend ::Pancake::Hooks::InheritableInnerClasses
end

# Vendored from http://eigenclass.org/hiki/instance_exec
# 2009-06-02
# Adapted for ruby 1.9 where the method is deinfed on Object
unless Object.method_defined?(:instance_exec)
  class Object
   # Like instace_eval but allows parameters to be passed.
    def instance_exec(*args, &block)
      mname = "__instance_exec_#{Thread.current.object_id.abs}_#{object_id.abs}"
      Object.class_eval{ define_method(mname, &block) }
      begin
        ret = send(mname, *args)
      ensure
        Object.class_eval{ undef_method(mname) } rescue nil
      end
      ret
    end
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
hassox-pancake-0.1.6 lib/pancake/core_ext/object.rb
pancake-0.2.0 lib/pancake/core_ext/object.rb
pancake-0.1.29 lib/pancake/core_ext/object.rb
pancake-0.1.28 lib/pancake/core_ext/object.rb
pancake-0.1.27 lib/pancake/core_ext/object.rb
pancake-0.1.26 lib/pancake/core_ext/object.rb
pancake-0.1.25 lib/pancake/core_ext/object.rb
pancake-0.1.24 lib/pancake/core_ext/object.rb
pancake-0.1.22 lib/pancake/core_ext/object.rb
pancake-0.1.20 lib/pancake/core_ext/object.rb
pancake-0.1.19 lib/pancake/core_ext/object.rb
pancake-0.1.18 lib/pancake/core_ext/object.rb
pancake-0.1.17 lib/pancake/core_ext/object.rb
pancake-0.1.16 lib/pancake/core_ext/object.rb
pancake-0.1.15 lib/pancake/core_ext/object.rb
pancake-0.1.13 lib/pancake/core_ext/object.rb
pancake-0.1.12 lib/pancake/core_ext/object.rb
pancake-0.1.10 lib/pancake/core_ext/object.rb
pancake-0.1.8 lib/pancake/core_ext/object.rb