From 7555073803ffb455715b74664a0cfb48c271fe89 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 28 Dec 2007 05:42:12 +0000 Subject: Ruby 1.9 compat: introduce instance_variable_names. Closes #10630 [Frederick Cheung] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8499 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../lib/active_support/core_ext/object/instance_variables.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activesupport/lib/active_support/core_ext/object') diff --git a/activesupport/lib/active_support/core_ext/object/instance_variables.rb b/activesupport/lib/active_support/core_ext/object/instance_variables.rb index e07eb76c1d..57276135c4 100644 --- a/activesupport/lib/active_support/core_ext/object/instance_variables.rb +++ b/activesupport/lib/active_support/core_ext/object/instance_variables.rb @@ -13,6 +13,10 @@ class Object end end + def instance_variable_names + instance_variables.map(&:to_s) + end + def copy_instance_variables_from(object, exclude = []) #:nodoc: exclude += object.protected_instance_variables if object.respond_to? :protected_instance_variables -- cgit v1.2.3