aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/object_and_class.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/object_and_class.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/object_and_class.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/object_and_class.rb b/activesupport/lib/active_support/core_ext/object_and_class.rb
index 4856a9f5d5..d44afbd839 100644
--- a/activesupport/lib/active_support/core_ext/object_and_class.rb
+++ b/activesupport/lib/active_support/core_ext/object_and_class.rb
@@ -65,6 +65,12 @@ class Object #:nodoc:
def to_json
ActiveSupport::JSON.encode(self)
end
+
+ unless defined? instance_exec # 1.9
+ def instance_exec(*arguments, &block)
+ block.bind(self)[*arguments]
+ end
+ end
end
class Class #:nodoc: