lib/extensions/object.rb in scudco-taza-0.8.4 vs lib/extensions/object.rb in scudco-taza-0.8.5

- old
+ new

@@ -1,8 +1,12 @@ # instance_exec comes with >1.8.7 thankfully if VERSION <= '1.8.6' class Object + def metaclass + class << self; self; end + end + module InstanceExecHelper; end include InstanceExecHelper # instance_exec method evaluates a block of code relative to the specified object, with parameters whom come from outside the object. def instance_exec(*args, &block) begin @@ -18,7 +22,12 @@ ensure InstanceExecHelper.module_eval{ remove_method(mname) } rescue nil end ret end + end +end +class Object + def metaclass + class << self; self; end end end