aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-11-10 16:56:01 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2010-11-10 16:57:12 -0200
commitc20838596bcb40bf1590f27f6ba735d0a5f4fe8f (patch)
tree1c4b75fa4378562a55a9d29fae73f3021a857d3d /activesupport/lib/active_support
parentb961c6c158d31e3648a3239ee6846ab98d027162 (diff)
downloadrails-c20838596bcb40bf1590f27f6ba735d0a5f4fe8f.tar.gz
rails-c20838596bcb40bf1590f27f6ba735d0a5f4fe8f.tar.bz2
rails-c20838596bcb40bf1590f27f6ba735d0a5f4fe8f.zip
Remove unused method
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core_ext/object/instance_variables.rb31
1 files changed, 0 insertions, 31 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
index 77a3cfc21d..eda9694614 100644
--- a/activesupport/lib/active_support/core_ext/object/instance_variables.rb
+++ b/activesupport/lib/active_support/core_ext/object/instance_variables.rb
@@ -30,35 +30,4 @@ class Object
else
alias_method :instance_variable_names, :instance_variables
end
-
- # Copies the instance variables of +object+ into +self+.
- #
- # Instance variable names in the +exclude+ array are ignored. If +object+
- # responds to <tt>protected_instance_variables</tt> the ones returned are
- # also ignored. For example, Rails controllers implement that method.
- #
- # In both cases strings and symbols are understood, and they have to include
- # the at sign.
- #
- # class C
- # def initialize(x, y, z)
- # @x, @y, @z = x, y, z
- # end
- #
- # def protected_instance_variables
- # %w(@z)
- # end
- # end
- #
- # a = C.new(0, 1, 2)
- # b = C.new(3, 4, 5)
- #
- # a.copy_instance_variables_from(b, [:@y])
- # # a is now: @x = 3, @y = 1, @z = 2
- def copy_instance_variables_from(object, exclude = []) #:nodoc:
- exclude += object.protected_instance_variables if object.respond_to? :protected_instance_variables
-
- vars = object.instance_variables.map(&:to_s) - exclude.map(&:to_s)
- vars.each { |name| instance_variable_set(name, object.instance_variable_get(name)) }
- end
end