aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-02-26 00:06:05 +0100
committerXavier Noria <fxn@hashref.com>2010-02-26 00:18:11 +0100
commit4dcc4a0b60fbcca0395ac94b62147e2f9567a425 (patch)
tree3131b716e7cf363b50ca5ec4b4582e21d910f175
parent47683b7d0ec5489aa01d1526c1b147528eca6170 (diff)
downloadrails-4dcc4a0b60fbcca0395ac94b62147e2f9567a425.tar.gz
rails-4dcc4a0b60fbcca0395ac94b62147e2f9567a425.tar.bz2
rails-4dcc4a0b60fbcca0395ac94b62147e2f9567a425.zip
AS guide: s/metaclass/singleton_class/ due to 0b87d11
-rw-r--r--railties/guides/source/active_support_core_extensions.textile15
1 files changed, 9 insertions, 6 deletions
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile
index ce87919b89..278d27ec67 100644
--- a/railties/guides/source/active_support_core_extensions.textile
+++ b/railties/guides/source/active_support_core_extensions.textile
@@ -138,16 +138,19 @@ end
NOTE: Defined in +active_support/core_ext/object/try.rb+.
-h4. +metaclass+
+h4. +singleton_class+
-The method +metaclass+ returns the singleton class on any object:
+The method +singleton_class+ returns the singleton class of the receiver:
<ruby>
-String.metaclass # => #<Class:String>
-String.new.metaclass # => #<Class:#<String:0x17a1d1c>>
+String.singleton_class # => #<Class:String>
+String.new.singleton_class # => #<Class:#<String:0x17a1d1c>>
</ruby>
-NOTE: Defined in +active_support/core_ext/object/metaclass.rb+.
+WARNING: Fixnums and symbols have no singleton classes, +singleton_class+
+raises +TypeError+ on them.
+
+NOTE: Defined in +active_support/core_ext/object/singleton_class.rb+.
h4. +class_eval(*args, &block)+
@@ -168,7 +171,7 @@ class Proc
end
</ruby>
-NOTE: Defined in +active_support/core_ext/object/metaclass.rb+.
+NOTE: Defined in +active_support/core_ext/object/singleton_class.rb+.
h4. +acts_like?(duck)+