aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/object/instance_variables.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/object/instance_variables.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/object/instance_variables.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/instance_variables.rb b/activesupport/lib/active_support/core_ext/object/instance_variables.rb
new file mode 100644
index 0000000000..72eaed70b6
--- /dev/null
+++ b/activesupport/lib/active_support/core_ext/object/instance_variables.rb
@@ -0,0 +1,8 @@
+class Object
+ # Available in 1.8.6 and later.
+ unless respond_to?(:instance_variable_defined?)
+ def instance_variable_defined?(variable)
+ instance_variables.include?(variable.to_s)
+ end
+ end
+end