diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2010-02-25 09:32:29 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-02-25 09:32:29 -0800 |
commit | f7b0a857e97304a5daeb47313759b9bf0d7e2fc9 (patch) | |
tree | 81bda0d86cc1d22e3e8c50e5e852d200aec7be57 /activesupport/lib/active_support/core_ext/object | |
parent | 6b12d74026808a3014f1dff34481006a96e0f18f (diff) | |
download | rails-f7b0a857e97304a5daeb47313759b9bf0d7e2fc9.tar.gz rails-f7b0a857e97304a5daeb47313759b9bf0d7e2fc9.tar.bz2 rails-f7b0a857e97304a5daeb47313759b9bf0d7e2fc9.zip |
Use Object#singleton_class instead of #metaclass. Prefer Ruby's choice.
Diffstat (limited to 'activesupport/lib/active_support/core_ext/object')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/metaclass.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/metaclass.rb b/activesupport/lib/active_support/core_ext/object/metaclass.rb index 93fb0ad594..4b36a243c9 100644 --- a/activesupport/lib/active_support/core_ext/object/metaclass.rb +++ b/activesupport/lib/active_support/core_ext/object/metaclass.rb @@ -1,13 +1,14 @@ +require 'active_support/deprecation' + class Object - # Get object's meta (ghost, eigenclass, singleton) class + # Get object's meta (ghost, eigenclass, singleton) class. + # + # Deprecated in favor of Object#singleton_class. def metaclass class << self self end end - # If class_eval is called on an object, add those methods to its metaclass - def class_eval(*args, &block) - metaclass.class_eval(*args, &block) - end + deprecate :metaclass => :singleton_class end |